Copy Code code as follows:
<title>Form</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<body>
<form action= "post.php" method= "Get" Name= "Form1" >
<table width= "271" border= "0" align= "center" cellpadding= "0" cellspacing= "0" >
<tr>
<TD width= "><div" align= "right" > name:</div></td>
<TD width= "186" ><input name= "username" type= "text" id= "username" ></td>
</tr>
<tr>
<td><div align= "Right" > Password:</div></td>
<td><input name= "password" type= "password" id= "password" ></td>
</tr>
<tr>
<td><div align= "Right" > Password confirmation:</div></td>
<td><input name= "password2" type= "password" id= "Password2" ></td>
</tr>
<tr>
<td><div align= "right" > Sex:</div></td>
<td><select name= "Sex" id= "sex" >
<option value= "0" selected> male </option>
<option value= "1" > Women </option>
</select></td>
</tr>
<tr>
<td><div align= "Right" > Birthday:</div></td>
<td><input name= "Birthday" type= "text" id= "Birthday" ></td>
</tr>
<tr>
<td><div align= "right" >E-mail:</div></td>
<td><input name= "Email" type= "text" id= "email" ></td>
</tr>
<tr>
<td><div align= "Right" > Career:</div></td>
<td><input name= "Job" type= "text" id= "Job" ></td>
</tr>
</table>
<p align= "center" >
<input type= "Submit" value= "Submit" >
<input type= "reset" value= "reset" >
</p>
</form>
</body>
Copy Code code as follows:
<?php
This program is used to receive form data from HTML pages and to output each field
echo "user input is as follows:<br>";
echo "Name:". $_get[' username '. " <BR> ";
echo "Password:". $_get[' password '. " <BR> ";
echo "Password confirmation:". $_get[' Password2 '. " <BR> ";
echo "Sex:". $_get[' sex '. " <BR> ";
echo "Birthday:". $_get[' birthday '. " <BR> ";
echo "e-mail:". $_get[' email '. " <BR> ";
echo "Occupation:". $_get[' job '. " <BR> ";
?>
Copy Code code as follows:
<?php
This program is used to receive form data from HTML pages and to output each field
echo "user input is as follows:<br>";
echo "Name:". $_post[' username '. " <BR> ";
echo "Password:". $_post[' password '. " <BR> ";
echo "Password confirmation:". $_post[' Password2 '. " <BR> ";
echo "Sex:". $_post[' sex '. " <BR> ";
echo "Birthday:". $_post[' birthday '. " <BR> ";
echo "e-mail:". $_post[' email '. " <BR> ";
echo "Occupation:". $_post[' job '. " <BR> ";
?>