Php form data acquisition code

Source: Internet
Author: User

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> ";
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.