Register
<center>
<form action="" method="post" >
<table>
<tr><td>your name:</td><td><input type="text" name="username"/></td></tr>
<tr><td>your password:</td><td><input type="password" name="password"/></td></tr>
<tr><td>your age:</td><td><input type="text" name="age"/></td></tr>
<tr><td>your email:</td><td><input type="text" name="email"/></td></tr>
<tr><td>your country:</td><td><input type="text" name="country"/></td></tr>
</table>
<hr/>
<input type="submit" value="register" name="submit" />
</form>
</center>
<?php
$usernam=$_POST['username'];
$password=$_POST['password'];
$age=$_POST['age'];
$email=$_POST['email'];
$country=$_POST['country'];
if ($_POST['submit']){
if ($username!='' &&$password!=''&&$age!=''&&$email!=''&&$country!=''){
$connect=mysql_connect("localhost","root","root");
mysql_select_db("register");
$query=mysql_query("INSERT INTO rg VALUES('$username','$password','$age','$email','$country')");
if ($query){
echo "thank you for register";
}
else{
echo "error";
}
}
else{
echo "register please";
}
}
?>
التعليقات