Problem in submitting form

FORM :

NAME:

AGE:

ADDRESS:

Residential status : resident

non-resident


Profession:

student teacher engineer other

[b]

SCRIPT:[/b]

<?php $name=$_GET['name']; $age=$_GET['age']; $address=$_GET['address']; $resident=$_GET['resident']; $profession=$_GET['profession']; if(empty($name)){ die('ERROR:please provide your name.'); } if(empty($age)){ die('ERROR:please provide your age.'); } if(empty($address)){ die('ERROR:please provide your address.'); } if(empty($resident)){ die('ERROR:please provide your residential status'); } if(empty($profession)){ die('ERROR:please select your profession'); } if(strcmp($resident,'no')==0){ die('ERROR:only resident members are eligible');} $to='[email protected]'; $from='[email protected]'; $subject='Application for membership'; $body="Name:$name\r\nAddress:$address\r\nAge:$age\r\nResidential status:$resident\r\nProfession:$profession\r\n"; if(mail($to,$subject,$body,"From:$from")) { echo'Thank you for your application.'; } else { die('ERROR:mail delivery error'); } ?>

Hi Kushal,

Can you be specific what error messages are you getting?

Cheers… :slight_smile:

@codeguru…there is no action at all on clicking submit button. :frowning:

[code]
NAME:

AGE:

ADDRESS:

Residential status : resident

non-resident


Profession:

student teacher engineer other

[/code]

You had ending the form after age and not starting a new one. The submit button wasn’t in a form with an action. So it did nothing.

Sponsor our Newsletter | Privacy Policy | Terms of Service