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. Link to comment https://forums.phpfreaks.com/topic/252338-simple-html-submit-form-using-php-not-working/ 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> Link to comment https://forums.phpfreaks.com/topic/252338-simple-html-submit-form-using-php-not-working/#findComment-1293704 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? Link to comment https://forums.phpfreaks.com/topic/252338-simple-html-submit-form-using-php-not-working/#findComment-1293737 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? Link to comment https://forums.phpfreaks.com/topic/252338-simple-html-submit-form-using-php-not-working/#findComment-1293739 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. Link to comment https://forums.phpfreaks.com/topic/252338-simple-html-submit-form-using-php-not-working/#findComment-1293741 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 Link to comment https://forums.phpfreaks.com/topic/252338-simple-html-submit-form-using-php-not-working/#findComment-1293743 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? Link to comment https://forums.phpfreaks.com/topic/252338-simple-html-submit-form-using-php-not-working/#findComment-1293744 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 Link to comment https://forums.phpfreaks.com/topic/252338-simple-html-submit-form-using-php-not-working/#findComment-1293745 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. Link to comment https://forums.phpfreaks.com/topic/252338-simple-html-submit-form-using-php-not-working/#findComment-1293746 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.