服务器变量 超级全局数组$_SERVER (附加超简单表单与html5表单属性)
2015-01-13 21:53
288 查看
001.html
001.php
<html> <head><title>user log</title> <meta http-equiv="content-type" content="text/html;charset:utf-8"> </head> <body> <form method="post" action="001.php"> 用户名:<input type="text" name="user_name" required="required" placeholder="请填写用户名">//html5表单属性 密码:<input type="password" name="pwd" required="required" placeholder="********">//html5表单属性 <input type="submit" name="submit" value="log"> </form> </body> </html>
001.php
<html> <title>Welcome!!!</title> <body> <?php $name=$_POST['user_name']; $pwd=$_POST['pwd']; ?> <p align='center'> Welcome new customer! </p> <p align='center'> Your username is <?php echo $name; ?><br> Your password is <?php echo $pwd; ?><br> </p> <!--$_SERVER比较常用的字段--> <p align='center'>根文件位于:<?php echo dirname($_SERVER["PHP_SELF"]) ?><br> 服务器名称:<?php echo $_SERVER["SERVER_NAME"] ?><br> 用的软件是:<?php echo $_SERVER["SERVER_SOFTWARE"] ?><br> http协议:<?php echo $_SERVER["SERVER_PROTOCOL"] ?><br> 数据提交方法:<?php echo $_SERVER["REQUEST_METHOD"]." 接受请求的时间:".date('Y-m-d H:i:s',$_SERVER["REQUEST_TIME"]) ?><br> 文件目录是:<?php echo $_SERVER["DOCUMENT_ROOT"] ?><br> 代理:<?php echo $_SERVER["HTTP_USER_AGENT"] ?><br> IP地址:<?php echo $_SERVER["REMOTE_ADDR"] ?> </p> <!--服务器变量$_SERVER数组全部--> <table width='100%' border='1'> <?php foreach($_SERVER as $key=>$value){ echo <<<EOT <tr> <td width='25%'>$key</td> <td>$value</td> </tr> EOT; } ?> </table> </body> </html>
相关文章推荐
- HTML5 服务器推送事件(Server-sent Events)简单实例
- php-SERVER超全局变量(数组)的详细信息
- php9个超级全局数组变量和7个系统常量
- [html5入门-12]html布局中form表单的简单用法和常用属性设置
- IIS Server Variables(IIS 服务器变量)
- ASP.NET 2.0服务器控件开发之简单属性
- ASP.NET 2.0服务器控件开发之简单属性
- ASP.NET 2.0服务器控件开发之简单属性
- 别人整理的服务器变量:$_SERVER
- PHP服务器变量$_SERVER详解(个人整理)
- 对于asp.net中的服务器变量HttpContext.Current.Request.ServerVariables
- REQUEST对象的ServerVariables属性的变量列表
- HttpContext.Current.Request.ServerVariables 所有命名的服务器变量的名称和值。
- IIS Server Variables(IIS 服务器变量)
- MySQL - 翻译 - 5.1 Reference Manual参考手册 - 5.1.3 Server System Variables服务器系统变量 - max_heap_table_size
- 变量的属性(全局变量、局部变量、动态变量、静态变量等)
- ASP.NET 2.0服务器控件开发之简单属性
- ServerVariables 服务器变量大全[ASP]
- server 2003 stmp服务器简单配置 以及.net 下发送邮件
- winform全局变量,传参,cache,datagrid简单介绍(转贴)