I'm doing a sign up form page where I should put also a "telephone" input but i need the telephone field to be 8 digits!!! if a user put a number more or less than 8 digits the signup form tells him an error.
it should be like this i think... after connecting to DB
$telephone=$_POST['telephone'];
...
....
if(empty($telephone)){ // **i think i should write smth here???**
echo "phone number not set, and should be 8 digits!!" ;
}
else{
/* Now we will write a query to insert user details into database */
$insert_user=mysql_query("INSERT INTO login (telephone) VALUES ('$telephone')");
i appreciate any help :) thank you