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>

 

相关文章:

  • 2021-11-30
  • 2021-08-06
猜你喜欢
  • 2021-11-11
  • 2021-12-03
  • 2022-01-08
  • 2021-10-20
  • 2022-12-23
  • 2021-09-12
  • 2021-11-30
相关资源
相似解决方案