宽容他人,放过自己。

HTML表单和php交互

Posted on By anchoriteFili

1. 在idea中直接创建相关代码

752372-20151215162736709-826880245.png

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表单php交互</title>
</head>
<body>

<form action="http://localhost/MyService/Servic.php" method="post">
    用户名:<input type="text" name="name">
    密 码:<input type="password" name="password">
    <br/>
    <input type="submit" value="提交">
</form>

</body>
</html>
2. 在Eclipse中创建相关代码

752372-20151215162934068-253797266.png

<?php
echo "用户名:" .$_POST['name']. "<br>密码:" .$_POST['password'];