欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP程序開發(fā)范例學(xué)習(xí)之表單 獲取文本框的值

 更新時間:2011年08月08日 18:53:04   作者:  
表單在網(wǎng)站中的應(yīng)用可以說是網(wǎng)站的根基,幾乎沒有不用表單的網(wǎng)站,還是先回顧一下表單的用法吧
<form name="form" method="post" action="login.php"></form>
  文本框的用法:
  <input type="text" name="username" />
  其中input類型包括text、password等類型,HTML5新增了很多的input類型,如果想學(xué)習(xí)這類的知識可以很好的了解一下,因為分的越細,用的越方便。
  
  看看本實例的功能

  填入表單提交后:


實現(xiàn)代碼:

復(fù)制代碼 代碼如下:

<table width="283" height="85" border="1" cellpadding="0" cellspacing="0">
<form name="name1" method="post" action="abc.php">
<tr>
<td width="114" height="30" align="center" >管理員:</td>
<td width="163" height="30" align="center"><input name="username" type="text" /></td>
</tr>
<tr>
<td align="center">密 碼:</td>
<td height="30" align="center"><input name="password" type="password" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td height="25">&nbsp;&nbsp;<input name="submit" type="submit" value="submit" /></td>
</tr>
</form>
</table>
<?php
if(!isset($_POST['submit']))
return ;
if($_POST['submit']=='submit'){
$username = $_POST['username'];
$password = $_POST['password'];
}
echo <<<EOT
<table width="284" border="1" cellpadding="0" cellspacing="0">
<tr>
<td height="25" align="center"> 管理員:$username</td>
</tr>
<tr>
<td height="25" align="center" valign="middle" class="style2">密碼:$password</td>
</tr>
</table>
EOT;
?>

使用 isset()函數(shù)判斷$_POST['submit']是否被設(shè)置

相關(guān)文章

最新評論