Les nouveautés et Tutoriels de Votre Codeur | SEO | Création de site web | Création de logiciel





seo Error Handling & Insert Data using PHP Script 2013

Seo Master present to you:

form-action.php
/*
mysql_connect("localhost","root","") or die (mysql_error());
mysql_select_db("formexample") or die (mysql_error());


if(isset($_REQUEST['submit']))
{


$Fname = $_POST["Fname"];
$Lname = $_POST["Lname"];
$gender = $_POST["gender"];
$food = $_POST["food"];
$quote = $_POST["quote"];
$education = $_POST["education"];
$TofD = $_POST["TofD"];

if(empty($Fname))
{
$error="First Name cannot be empty";

}
else if (empty($Lname))
{
$error="Last Name cannot be empty";

}

else if (empty($gender))
{
$error="Gender cannot be empty";

}
else if (empty($food))
{
$error="Food cannot be empty";

}

else if (empty($quote))
{
$error="Quote cannot be empty";

}
else if (empty($education))
{
$error="Education cannot be empty";

}
else if (empty($TofD))
{
$error="Favorite time cannot be empty";

}


if($error==NULL)
{
$data="";
$data=implode(",",$food);

$query="insert into form values('','$Fname','$Lname','$gender','$data','$quote','$education','$TofD')";
$result=mysql_query($query);
if($result)
{
$succes = "Succesfuly added your information";
}

?>




}
else
{
?>





}

}

?>
*/


Form.php

/*


Personal INFO







echo $err=$_REQUEST['err'];
?>







echo $succes=$_REQUEST['succes'];
?>













































First Name:

Last Name:

Gender: Male Female
Please choose type of residence Burger Pizza Chicken
Your comments:
Select a Level of Education:
Select your favorite time of day:



*/

2013, By: Seo Master

Labels:



Leave A Comment:

Powered by Blogger.