Copy codeThe Code is as follows:
<Html>
<Head>
<Title> Form </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
</Head>
<Body>
<Form action = "post. php" method = "get" name = "form1">
<Table width = "271" border = "0" align = "center" cellpadding = "0" cellspacing = "0">
<Tr>
<Td width = "85"> <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"> Gender: </div> </td>
<Td> <select name = "sex" id = "sex">
<Option value = "0" selected> male </option>
<Option value = "1"> female </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"> Email: </div> </td>
<Td> <input name = "email" type = "text" id = "email"> </td>
</Tr>
<Tr>
<Td> <div align = "right"> occupation: </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>
</Html>
Copy codeThe Code is as follows:
<? Php
// This program is used to receive form data from HTML pages and output each field
Echo "user input: <BR> ";
Echo "name:". $ _ GET ['username']. "<BR> ";
Echo "password:". $ _ GET ['Password']. "<BR> ";
Echo "Confirm Password:". $ _ GET ['password2 ']. "<BR> ";
Echo "Gender:". $ _ GET ['sex']. "<BR> ";
Echo "birthday:". $ _ GET ['birthday']. "<BR> ";
Echo "E-mail:". $ _ GET ['email ']. "<BR> ";
Echo "Occupation:". $ _ GET ['job']. "<BR> ";
?>
Copy codeThe Code is as follows:
<? Php
// This program is used to receive form data from HTML pages and output each field
Echo "user input: <BR> ";
Echo "name:". $ _ POST ['username']. "<BR> ";
Echo "password:". $ _ POST ['Password']. "<BR> ";
Echo "Confirm Password:". $ _ POST ['password2 ']. "<BR> ";
Echo "Gender:". $ _ POST ['sex']. "<BR> ";
Echo "birthday:". $ _ POST ['birthday']. "<BR> ";
Echo "E-mail:". $ _ POST ['email ']. "<BR> ";
Echo "Occupation:". $ _ POST ['job']. "<BR> ";
?>