Dear experts!
I have some 8 input text fields in my signup form, on which i wanted to hav 6 fields required and 2 fields optional (i.e) Phone number and Email address.
When i am done with the form filling and submit, it shows error! It seems without filling these 2 fields, the post cant be made successfully. I want this last two fields be optional for the user, that he may or may not input in that. Please help me with this…
???
My form
[hr]
[php]
Create
[/php]
My signup script
[hr]
[php]
<?php include_once("db.php") ?> <?php $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $rollno = $_POST['roll']; $username = $_POST['name']; $password = $_POST['pass']; $date = $_POST['date']; $phone = $_POST['phone']; $email = $_POST['email']; $sql = "INSERT into login (firstname, lastname, rollno, username, password, date, phone, email) values('".$firstname."','".$lastname."',".$rollno.",'".$username."','".$password."','".$date."',".$phone.",'".$email."')"; # $sql = "INSERT into login values('".$firstname."','".$lastname."',".$rollno.",'".$username."','".$password."','".$date."',".$phone.",'".$email."')"; $qury = mysql_query($sql); if(!$qury){ header("location:ad_new_user_err.php?");} else{ header("location:ad_new_user_successful.php?");} ?>[/php]