Jump to content

Form validation


OriginalBoy

Recommended Posts

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...

Link to comment
https://forums.phpfreaks.com/topic/99651-form-validation/#findComment-509773
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/99651-form-validation/#findComment-509776
Share on other sites

$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

Link to comment
https://forums.phpfreaks.com/topic/99651-form-validation/#findComment-509778
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.