Hi everyone. I've written a code that contains HTML & JS & PHP , in the code below There must be a list that you can enter your information , I'm thinking of using PHP & PDO (both together) to get the information entered , & store them & display the information in wherever part of the page, however I've used script in the code below (with no sense) but it's not necessary for me to use it , you can "comment" it , that's OKey. Just I need the exact code to see if the result is as the same as what I've wanted or not, so I'll be glad to write me the exact code & complete my code below: (however you can write me down more simplify , you can just focus on 2-3 fields of info , if you help me I'll complete the whole code myself)

Thanks everyone



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Store it in a table</title>
<script>
{
var fn=document.forms["myForm"]["fname"].value;
var ln=document.forms["myForm"]["lname"].value;
var x=document.forms["myForm"]["email"].value;
var g=document.forms["myForm"]["gender"].value;
//var birth=document.forms["myForm"]["year"].value + "/" document.forms["myForm"]["month"].value + "/" + document.forms["myForms"]["day"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
var adr=document.forms["myForm"]["info"].value;
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
alert("Not a valid e-mail address");
//return false;
}
}
alert(fn);
if (fn==null || fn=="")
{
alert("First Name must be filled out!");
}

if (ln==null || ln=="")
{
alert("Last Name must be filled out!");
}

if (g==null)
{
alert("Choose your gender!");
}
//}
</script>
</head>

<body>
<!--<form name="myForm" action="demo_form.asp" onsubmit="return validateForm();" method="post"> -->
<form method="post" action="" name="myForm" onsubmit="return validateForm ();">
<p>Please, Complete the information are required below:</p>
First Name: <input type="text" name="fname" />
Last Name: <input type="text" name="lname" /> <br/><br/>
Email: <input type="email" name="email" placeholder="e.g:asmj@gmail.com"/> <br/><br/>
Gender: <input type="radio" name="gender" /> male
<input type="radio" name="gender"/> female <br/><br/>
Select your Birth date:<br/>
Year: <Select name="year">
<?php for ($y=1920; $y<=2000; $y++){
echo "<option> ".$y." </option>";
} ?>
</Select>

Month: <Select name="month">
<?php for ($m=1; $m<=12; $m++){
switch ($m)
{
case "1":
echo "<option> ".Jan." </option>";
break;
case "2":
echo "<option > ".Feb." </option>";
break;
case "3":
echo "<option> ".March." </option>";
break;
case "4":
echo "<option> ".April." </option>";
break;
case "5":
echo "<option> ".May." </option>";
break;
case "6":
echo "<option> ".June." </option>";
break;
case "7":
echo "<option> ".July." </option>";
break;
case "8":
echo "<option> ".Agust." </option>";
break;
case "9":
echo "<option> ".Sep." </option>";
break;
case "10":
echo "<option> ".Oct." </option>";
break;
case "11":
echo "<option> ".Nov." </option>";
break;
case "12":
echo "<option> ".Dec." </option>";
break;

default:
echo "<option> ".Dec." </option>";
}
}
?>
</Select>


Day: <select name="day">
<?php for ($d=1; $d<=31; $d++){ ?>
<option> <?php echo ($d); ?> </option>
<?php } ?>
</select>
<br/><br/>

Type your address in the below text area:<br/>
<textarea name="info"></textarea><br/><br />

<input type="submit" name="submit" value="Okey"/>
<input type="reset" name="reset" value="Clear all"/>
</form>
<div>

<?php
print_r($_POST);
if($_POST["fname"]== null)
?>

</div>

</body>
</html>