我是新來的,學習使用formdata.php創建一個簡單的表單。 問題是當我填寫密碼並單擊表單下方的圖像按鈕時,我得到一個空白頁面。用formdata.php創建一個簡單的表單。值不顯示。而是一個空白頁面。如何解決它?
這裏有什麼問題?
這是form.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Forms</title>
</head>
<body>
<form action="formdata.php" method="GET" name="form">
<fieldset>
<legend>Put your bio</legend>
<p><label>type your name: <input type="text" name="name" size="30" maxlength="10"><label></p>
<p><label>type your pass: <input type="text" name="password" size="30" maxlength="10"><label></p>
</fieldset>
<fieldset>
<legend>Common</legend>
<p>Do you like flowers?</p>
<p><label>Yes<input type="radio" name="time" value="yes" checked><label> <label>No<input type="radio" name="time" value="no"><label></p>
<p>what tools do you use to save time?</p>
<p>
<label><input type="checkbox" name="diary" checked>Diary</label>
<label><input type="checkbox" name="chrono" disabled>Chrono</label>
<label><input type="checkbox" name="own">Own tools</label>
</fieldset>
<p>
<label for="sleep">how much time do you sleep?<label for="text">
</p>
<p>
<select name="sleep" size="5" multiple id="sleep">
<option>5</option>
<option>6</option>
<option selected>7</option>
<option>8</option>
</select>
</p>
<p><label for="text">Share your experience:</label></p>
<p><textarea name="text" cols="30" rows="6" id="text">wow!</textarea></p>
<p><input type="reset" name="reset" value="clear"><input type="submit" name="submit" value="Go"></p>
<p><input type="image" img src="images/ibutton.png" name="imagebutton"></p>
<p><input type="button" name="button" value="oops"></p>
</form>
</body>
</html>
這是formdata.php:
<?php
echo $_GET['password'];
?>
Form.html和formdata.php位於同一文件夾。 Denwer服務器啓動並運行,說沒關係。 瀏覽器中的信息如下所示:
C:/WebServers/home/html.loc/www/formdata.php? name = & password = 12345 & time = yes & diary = on & sleep = 7 & text =哇! & imagebutton.x = 84 & imagebutton.y = 34
我應該在頁面上獲得「12345」,而只是一個空白頁面。
非常感謝!工作正常! – drebot