PHP 之 表单提交

1.创建 index.php 文件

<?php 
    header("Content-type:text/html; charset=utf-8");


    printf("Hi %s <br>",$_POST['name']);
    printf("The email address %s <br>",$_POST['email']);

 

2. xxx.html文件

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
</head>

<body>
<div data-role="page">
    <div class="ui-content">
        <form action="index.php" method="post">
            Name: <input type="text" name="name"><br>
            E-mail: <input type="text" name="email"><br>
            <input type="submit" value="提交">
        </form>
    </div>
</div>

</body>

 

posted on 2017-11-26 13:44  xjxhxhl  阅读(71)  评论(0编辑  收藏  举报

导航