【发布时间】:2014-12-20 21:41:12
【问题描述】:
我是 php 新手,我只想回显名字,谁能帮帮我!
当我点击提交按钮时,它会重定向到 action.php,然后我想要 从上一页的表单中呼应我的名字。
这是我的代码:
action.php
<?php
echo "Great! Thanks" . $s1 . " for responding to our survey" ;
?>
index.php
<head>
<title>Idiot Box Survey</title>
<meta charset="utf-8">
</head>
<body>
<form action="action.php" method="post">
<label>Firstname : </label>
<input type="text" name="fname"><br><br>
<label>Lastname : </label>
<input type="text" name="lname"><br><br>
<label>Year of birth : </label>
<input type="date" name="ybirth"><br><br>
<label>Year at School : </label>
<input type="date" name="yschool"><br><br>
<label>When will You Wake up : </label>
<input type="time" name="wake"><br><br>
<label>How much time you spend on studying : </label>
<input type="time" name="study"><br><br>
<label>How much time you spend on Video games : </label>
<input type="time" name="vgames"><br><br>
<label>How much time you spend on tv : </label>
<input type="time" name="tv"><br><br>
<label>How much time you spend with family : </label>
<input type="time" name="family"><br><br>
<label>How much time you spend with friends : </label>
<input type="time" name="friends"><br><br>
<label>When will You Sleep : </label>
<input type="number" name="sleep"><br><br>
<button type="submit" name="submit"> Submit Form </button>
</form>
</body>
【问题讨论】:
-
我认为您缺少
action.php的代码? -
我缺少什么代码? @Bijan