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>
时间: 2024-10-13 10:11:23