miinet Posted August 15, 2008 Share Posted August 15, 2008 I'm wondering if it's possible to submit a form to itself if there were validation errors, but submit to another page if there weren't any errors? My script works, but I want to be able to submit to another page if there weren't any errors rather than submitting to itself. I just want it to submit to itself if there were errors and show the error fields in a different color. function error($err, $field) { if($error[field]) { print("<td style=color:red>"); } else { print("<td>">; } } function show_form() { //html code //form action is blank right now } if(isset($_POST["Submit"])){ check_form(); } else{ show_form(); } function check_form() { //validation if else statements //if there were errors then you show the form show_form() } Link to comment https://forums.phpfreaks.com/topic/119772-solved-submit-form-to-self-or-another-page/ Share on other sites More sharing options...
trq Posted August 15, 2008 Share Posted August 15, 2008 That doesn't really make allot of sense considering the page needs to be submitted to somewhere in order to be validated by php. Can't very well make the decision after the fact. Link to comment https://forums.phpfreaks.com/topic/119772-solved-submit-form-to-self-or-another-page/#findComment-617043 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.