BLinCT Posted November 25, 2012 Share Posted November 25, 2012 on this test pag: http://www.webauthorsgroup.com/index2.html, I created an "include" file (for the php form script), but if you just click on (or forgot a field) the submit button, it doesn't produce the error above the form, but rather it produces a seperate page with the form and error(s). How can I correct this so that the error messages are echoed on the same page? Quote Link to comment https://forums.phpfreaks.com/topic/271160-form-validation-error/ Share on other sites More sharing options...
MDCode Posted November 25, 2012 Share Posted November 25, 2012 You have the form pointed to contact.php, and will always go to contact.php Quote Link to comment https://forums.phpfreaks.com/topic/271160-form-validation-error/#findComment-1395032 Share on other sites More sharing options...
Love2c0de Posted November 25, 2012 Share Posted November 25, 2012 (edited) Is there any chance to see any PHP code? Set your form action to index2.php. At the top of that page(above the doctype declaration, you can process the code there). if(isset($_POST['name'])){ include("process_form.php"); } Regards, AoTB. Edited November 25, 2012 by AoTBuNgLe Quote Link to comment https://forums.phpfreaks.com/topic/271160-form-validation-error/#findComment-1395035 Share on other sites More sharing options...
MDCode Posted November 25, 2012 Share Posted November 25, 2012 Is there any chance to see any PHP code? Set your form action to index2.php. At the top of that page(above the doctype declaration, you can process the code there). if(isset($_POST['name'])){ include("process_form.php"); } Regards, AoTB. The URL is of an html file so unless they have it configured to parse php, they would need an ajax call. And then all the errors would be displayed at the top of the page instead of where they want Quote Link to comment https://forums.phpfreaks.com/topic/271160-form-validation-error/#findComment-1395045 Share on other sites More sharing options...
BLinCT Posted November 26, 2012 Author Share Posted November 26, 2012 I will attempt some of these options....I really do appreciate your help and input on this....I'm no expert in php, but I love the programming and will always work with it!....thanks guys! Quote Link to comment https://forums.phpfreaks.com/topic/271160-form-validation-error/#findComment-1395057 Share on other sites More sharing options...
AyKay47 Posted November 26, 2012 Share Posted November 26, 2012 Posting all relevant code will really help in resolving this. Quote Link to comment https://forums.phpfreaks.com/topic/271160-form-validation-error/#findComment-1395060 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.