Hi,I am working on this code.the problem is its not going to 2nd elseif(upload).
need suggestion.
if(empty($mobile))
{
echo '<script language="javascript">alert("Enter Phone Number")</script>;';
}
elseif(!(empty($mobile)))
{
if((is_numeric($mobile)))
{
if((strlen($mobile)!=10))
echo '<script language="javascript">alert("phone number should be of 10 digit")</script>;';
}
else
{
echo '<script language="javascript">alert("Please Enter valid phone number")</script>;';
}
}
elseif(!($_FILES["uploadedfile"]["type"]=="image/pjpeg" || $_FILES["uploadedfile"]["type"]=="image/jpeg" || $_FILES["uploadedfile"]["type"]=="image/jpg" || $_FILES["uploadedfile"]["type"]=="image/png"))
{
echo "i am in upload";
echo "<script language=\"javascript\">alert(\"Your uploaded file must be of JPG or GIF. Other file types are not allowed!!\")</script>;";
echo "<script type='text/javascript'>";
echo "</script>";
}
else
{
mysql_connect('localhost','root','');
mysql_select_db('project');
mysql_query("SET NAMES utf8");
//$result=mysql_query("Select * from tbl_hindi");
echo("INSERT INTO `project`.`tbl_hindi` (`pre`, `name`, `father`, `state`, `city`, `gender`, `mobile`, `dob`, `namdan_date`, `file` ,`relation`)VALUES ('$pre','$name','$father','$state','$city','$gender','$mobile','$dob','$namdan_date','$file','$relation')");
}