NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
debug form POST


Joined: 28 Sep 2013
Posts: 21
Location: Pantin, IDF, France
Reply with quote
Hello,

I just bought NuSphere PhpED version 13.0 (but I'm still waiting for the product I bought, so I have to use evaluation version in the meantime).
I'm not very used to work with it, so maybe I missed something very trivial.

I am trying to debug a PHP script including a Html POST form that calls back the same script with POST data when submitted.
On first run, the script debugs fine, and I am able to enter data into the form, and to submit it after.

I would have expected the debugger to enter again for a second debugging session, but this is not actually the case.
After submission, I just get an error page telling the following:
Code:
Unable to connect

Firefox can't establish a connection to the server at localhost.

* The site could be temporarily unavailable or too busy. Try again in a few moments.
* If you are unable to load any pages, check your computer's network connection.
* If your computer or network is protected by a firewall or proxy, make sure that Mozilla Developer Preview is permitted to access the Web.
[Try Again]
(Yes, I am using the embedded Firefox browser, but using another gives similar results)

How can I debug PHP scripts that are calling themselves with POST data?

I am running PhpED 13.0 on Windows 8.1 Update 1.

Regards,
Gilles
View user's profileFind all posts by GingkoSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7901
Reply with quote
It looks like the script you debugged in the 1st session has redirected somewhere where you don't have any web service and therefore firefox failed to connect -- it's what I see in the error message.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Sep 2013
Posts: 21
Location: Pantin, IDF, France
Reply with quote
dmitri wrote:
It looks like the script you debugged in the 1st session has redirected somewhere where you don't have any web service and therefore firefox failed to connect -- it's what I see in the error message.

Ok, I found the reason.

The form was redirecting to the content of a $selfname variable loaded with the following code:

Code:
$selfname = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];


Which translated by http://localhost/my_script_name.php and worked fine on the real Apache server.

But I realized that the PhpED Web Server was using port 8080 instead of the default 80 one, and the port number was not included in the $selfname contents.

I replaced the code by the following, and now it works properly:

Code:
$selfname = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['PHP_SELF'];


Now I am facing with a recurrent PhpED access violation crash when running the next part, but this is another problem.

Thank you for your answer.

Gilles
View user's profileFind all posts by GingkoSend private message
debug form POST
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic