<table border="0" cellpadding="1" cellspacing="1"> <tr> <td><select name="nameTitle1" id="select"> <option selected="selected">Mr.</option> <option>Ms.</option> <option>Mrs.</option> </select> </td> <td><input name="fName1" id="fName1" value="" size="17" type="text" /></td> <td><input name="lName1" id="lName1" value="" size="10" type="text" /> </td> </tr> <tr> <td><select name="nameTitle2" id="select"> <option selected="selected">Mr.</option> <option>Ms.</option> <option>Mrs.</option> </select> </td> <td><input name="fName2" id="fName2" value="" size="17" type="text" /></td> <td><input name="lName2" id="lName2" value="" size="10" type="text" /> </td> </tr> <tr> <td><select name="nameTitle3" id="select"> <option selected="selected">Mr.</option> <option>Ms.</option> <option>Mrs.</option> </select> </td> <td><input name="fName3" id="fName3" value="" size="17" type="text" /></td> <td><input name="lName3" id="mName3" value="" size="10" type="text" /> </td> </tr> </table> HTML: thats the HTML code, and when the users submit that form, whether the form is empty or not, only the filled up informations should be mailed to given email. I just know it is easier to do in ARRAY, but i am not so much in PHP can you help me??
Try this change according to ur requirement this worked for me <?php @extract($_POST); $name = stripslashes($name); $email = stripslashes($email); $subject = stripslashes($subject); $text = stripslashes($text); mail('haradeep@gmail.com',$subject,$text,"From: $name <$email>"); header("location:index.php"); ?>