文本框的用法:      其中input类型包括text、password等类型,HTML5新增了很多的" />

广州鸿名健康科技有限公司


PHP程序开发范例学习之表单 获取文本框的值

网络编程 PHP程序开发范例学习之表单 获取文本框的值 06-22
<form name="form" method="post" action="login.php"></form>
  文本框的用法:
  <input type="text" name="username" />
  其中input类型包括text、password等类型,HTML5新增了很多的input类型,如果想学习这类的知识可以很好的了解一下,因为分的越细,用的越方便。
  
  看看本实例的功能

查看图片

  填入表单提交后:

查看图片
实现代码:


<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> </td>
<td height="25"> <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()函数判断$_POST['submit']是否被设置

php简单的会话类代码
?phpclasssession{static$sessionObject;/*$_SESSION['user']==0,don'twork.*==1,heisreallyuser.*/privatefunction__construct(){if(!(isset($_SESSION['user'])&&$_SESSION['user']==0))session_set_cookie_params

初学PHP的朋友 经常问的一些问题。不断更新
最后更新时间:2011-8-1117:50:10你现在用哪个工具写php代码啊?答:一般就是用ZEND的ZendStudio,我目前用的是eclipse.org上下载的PDT,速度比ZendStudio8,要快些

PHP IF ELSE简化/三元一次式的使用
一般我们会这样写:?if($_GET['time']==null){$time=time();}else{$time=$_GET['time'];}echo$time;//如果GET有time这个值则带入变数time,如果没有就带现在time()时间?如果只单


编辑:广州鸿名健康科技有限公司

标签:类型,代码,的是,管理员,时间