首页 > Web开发 > 详细

HTML5表单提交与PHP环境搭建

时间:2015-06-13 06:18:18      阅读:202      评论:0      收藏:0      [点我收藏+]

PHP服务器使用xampp集成套件

路径

D:\xampp\htdocs\MyServer\index.php

访问

http://localhost/MyServer/index.php

能够正常显示页面,说明php服务端搭建成功

 

编写php代码

1 <?php
2     header("Content-type: text/html; charset=utf-8"); 
3     echo "用户名:".$_POST[‘username‘];
4     echo "<br />密码:".$_POST[‘password‘];
5 ?>

 

HTML表单

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>HelloWorld</title>
</head>
<body>
    <form action="http://localhost/MyServer/Service.php" method="post">
        <table>
            <tr>
                <td>用户名:</td>
                <td><input type="text" name="username"/></td>
            </tr>
            <tr>
                <td>密 码:</td>
                <td><input type="password" name="password"/></td>
            </tr>
            <tr>
                <td colspan="2" align="right">
                    <input type="submit" value="提交">
                </td>
            </tr>
        </table>
    </form>
</body>
</html>

 

HTML5表单提交与PHP环境搭建

原文:http://www.cnblogs.com/sherrykid/p/4572895.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!