OriginalBoy Posted April 5, 2008 Share Posted April 5, 2008 Hey, I created this form validation and it does'nt work at all! Wondering if someone can help me. The code can be found at http://pastie.caboo.se/175645 Its near the bottom like 542 it starts. Thanks, Steve Quote Link to comment https://forums.phpfreaks.com/topic/99651-form-validation/ Share on other sites More sharing options...
benjaminbeazy Posted April 5, 2008 Share Posted April 5, 2008 are you getting errors? Quote Link to comment https://forums.phpfreaks.com/topic/99651-form-validation/#findComment-509769 Share on other sites More sharing options...
OriginalBoy Posted April 5, 2008 Author Share Posted April 5, 2008 are you getting errors? No it just does not even check anything and continues onto the next page. you can check it out at carloanautocredit.com (please excuse no design we not got to that yet lol). Quote Link to comment https://forums.phpfreaks.com/topic/99651-form-validation/#findComment-509771 Share on other sites More sharing options...
benjaminbeazy Posted April 5, 2008 Share Posted April 5, 2008 Array ( [”zipcode”] => hjg ) Warning: Cannot modify header information - headers already sent by (output started at /home/content/r/g/a/rgarri33/html/submitform.php:2) in /home/content/r/g/a/rgarri33/html/submitform.php on line 4 Your Zip Code appears to be invalid. Please go back and try again. looks like something is working... Quote Link to comment https://forums.phpfreaks.com/topic/99651-form-validation/#findComment-509773 Share on other sites More sharing options...
OriginalBoy Posted April 5, 2008 Author Share Posted April 5, 2008 Array ( [”zipcode”] => hjg ) Warning: Cannot modify header information - headers already sent by (output started at /home/content/r/g/a/rgarri33/html/submitform.php:2) in /home/content/r/g/a/rgarri33/html/submitform.php on line 4 Your Zip Code appears to be invalid. Please go back and try again. looks like something is working... the array stuff is because i was testing something. U need to enter a valid zipcode 12345. I am talking about the main form. Quote Link to comment https://forums.phpfreaks.com/topic/99651-form-validation/#findComment-509776 Share on other sites More sharing options...
benjaminbeazy Posted April 5, 2008 Share Posted April 5, 2008 $zip = $_POST['fname']; if (empty($city)) { $errors[] = 'Please enter a zip'; } that code should be fixed, but the real problem is that your action points to a totally new script. hence none of the validation contained on this page will be processed as it's all sent to NewCarquoteform.php have the form point back to itself and validate it, then set a session var or something when everything is validated and do a header redirect... that would be the easy way with spaghetti code such as this Quote Link to comment https://forums.phpfreaks.com/topic/99651-form-validation/#findComment-509778 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.