|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
PHP stops executing after submit
[Windows Xp, PHP 4.2.2]
hi, I'm a PHP beginner and I'm working through some simple tutorials. I create to files, login.html and stevespage.php. Login.php contains a form which collects data and submits it to stevespage.php for display. Problem is that when I click on the submit button the target page is called and the HTML shows up but anything enclosed in the PHP tag is ignored?? Does anyone have any idea how I can sort this? Here's the code: login.php: <html> <head> <title>My Form</title> </head> <body> <form action="stevespage.php" method="POST"> <?php print ("PHP IS WORKING!");?> My name is: <br> <input type="text" name="YourName"> <p> My favorite dirty word is: <br> <input type="text" name="FavoriteWord"> <p> <input type="Submit" name="Submit" value="Enter My Data!"> </form> </body> </html> stevespage.php: <html> <head> <title>Title here!</title> </head> <body> <h1>HTML PRINTS OKAY!</h1> <?php print ("PHP IS WORKING!"); ?> </body> </html> Any help is GREATLY appreciated! Thanks Steve |
|
#2
|
|||
|
|||
|
RE: PHP stops executing after submit
In the stevespage.php
"PHP IS WORKING!" is not printed??? if you are trying to print the values of "YourName" and "FavoriteWord" you will have to use $_POST["YourName"] and $_POST["FavoriteWord"] instead of $YourName and $FavoriteWord.(Newer php versions has some changes). By the way,is php properly installed?Whats the web server? create a new phpfile <? phpinfo(); ?> and try calling that script |
|
#3
|
|||
|
|||
|
RE: PHP stops executing after submit
hi,
What happens is that when I press the submit button on the login.php, I get the HTML text ("HTML PRINTS OKAY") appearing on the page but not the text which I print via PHP i.e "PHP IS WORKING" does not print. The odd thing is that I include a PHP script in login.php which prints "PHP IS WORKING" and that works okay! It's only when I make the submission and it tries to execute the PHP script in stevespage.php . Also if I access the stevespage.php by simply loading it into a browser it works okay. The problem only occurs when the page is loaded because of a submission. Any ideas?? |
|
#4
|
|||
|
|||
|
RE: PHP stops executing after submit
Humm.... seems odd... check at least this code works..
|
|
#5
|
|||
|
|||
|
RE: PHP stops executing after submit
hi,
Tried running the code you supplied and got the following error: PHP Notice: Undefined index: submit in D:devFoxServwww~scp.php on line 2 |
|
#6
|
|||
|
|||
|
RE: PHP stops executing after submit
|
|
#8
|
|||
|
|||
|
RE: PHP stops executing after submit
hi,
Tried the following: <?php if($submit) { echo "Your name : ".$myName; echo "<br>Your Age : ".$myAge; } ?> <form action="<? echo $_SERVER['PHP_SELF'] ?>" method="POST"> My Name: <input type="text" name="myName"> <br> My Age: <input type="text" name="myAge"> <br> <input type="Submit" name="submit" value="Submit Data"> </form> ....and received the following error: PHP Notice: Undefined variable: submit in D:devFoxServwww~scp.php on line 2 I ran phpinfo() and gave a long list of variables and stuff do you want me to post the values here? |
|
#9
|
|||
|
|||
|
RE: PHP stops executing after submit
No... no need to post all those values here. I just wanted to make sure whether your PHP installation was successful... It seems to be ok.
I will think of this, Not sure what the error is about yet. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > PHP stops executing after submit |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|