shilpa Posted December 2, 2011 Share Posted December 2, 2011 Hi, I am learning PHP now, so pardon my silly question which I am not able to resolve from a week. I have created a simple web form where in I display the values entered by a user. <form action ="reply.php" id="myForm" method="post" > Name: <input type="text" name="name" size="25" maxlength="50" /> <br> </br> Description: <textarea name="editor1"> </textarea> <input type="submit" value="Submit" /> </form> and reply.php contains: <?php echo "In reply page"; foreach($_POST as $field => $value) { echo "$field = $value"; } ?> When I click on the submit button, I just get a blank page without any values from the form. Can anyone please let me know what am I missing? Set up: I am using Netbeans with PHP bundle added on to it. When i run only a simple php proj it displays that page in localhost/nameofproj, but when I run a php file along with a jsp file, it runs in localhost:8080/nameofproj. Is this the reason(localhost:8080 instead of just localhost ) for showing a blank page, not even a simple echo stmt, when i click on submit? I even re installed netbeans, still no luck. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
lynxus Posted December 2, 2011 Share Posted December 2, 2011 Try putting some id's in the form.. <form action ="reply.php" id="myForm" method="post" > Name: <input type="text" name="name" id="name" size="25" maxlength="50" /> <br> </br> Description: <textarea name="editor1" id="editor1"> </textarea> <input type="submit" value="Submit" /> </form> Quote Link to comment Share on other sites More sharing options...
Pandemikk Posted December 3, 2011 Share Posted December 3, 2011 ^? Can you verify that the URL clicking submit brings you to is the same as the URL of the reply.php script? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted December 3, 2011 Share Posted December 3, 2011 Do you get anything at all after you submit the form, or just a blank page? Is there anything in View ---> Source? Quote Link to comment Share on other sites More sharing options...
shilpa Posted December 3, 2011 Author Share Posted December 3, 2011 I did put id to forms and try. Forms are coming fine. Problem is only after i click on submit button in the form. After i click on submit it shows a blank page. The url after submit brings me to http://localhost:8080/sampleproj/reply.php, thats correct as in forms action i have given it as reply.php If i put the php page alone as a separate proj, it works fine. the url then is http://localhost/reply.php I installed netbeans again but still no luck, I am not understanding what am i doing wrong. Quote Link to comment Share on other sites More sharing options...
shilpa Posted December 3, 2011 Author Share Posted December 3, 2011 In view source, it shows me my reply.php file code Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted December 3, 2011 Share Posted December 3, 2011 Do you mean you can actually see the php code, as it is written in the file? If that's the case, are you sure PHP is installed properly, and that Apache is running? Quote Link to comment Share on other sites More sharing options...
shilpa Posted December 3, 2011 Author Share Posted December 3, 2011 When i hit submit, it displays a blank page but i can see my entire reply.php file when i click on view source. I am using netbeans to run this file and Apache is running Quote Link to comment Share on other sites More sharing options...
shilpa Posted December 3, 2011 Author Share Posted December 3, 2011 I followed netbeans docs and installed php5.3 and Apache2.2. Even i thgt I had messed up with the installations so reinstalled everything... But still looks like am missing something that I am not able to figure it out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.