有一個頁面:login.php如何在php頁面之間傳輸數據?
我嘗試通過窗體接收用戶名和密碼。
的login.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Giris Yap</title>
</head>
<body>
<form id="form1" name="form" method="post" action="welcome.php">
<table width="275" border="1">
<tr>
<td width="103">user; name: </td>
<td width="156"><label>
<input type="text" name= "name" />
</label></td>
</tr>
<tr>
<td>password:</td>
<td><label>
<input type="password" name="textfield2" />
</label></td>
</tr>
</table>
<p><label>
<input type="submit" name="Submit" value="submit" />
</label>
<label>
<input type="reset" name="Submit2" value="reset" />
</label>
</p>
</form>
<p> </p>
<p> </p>
</body>
</html>
之後,我要帶領我的網頁到的welcome.php並表示歡迎......名字......但它不工作。誰能幫我。
的welcome.php:
<?php
$name = $_REQUEST['name'];
echo "Welcome"$name;
?>
修復你的語法錯誤:'回聲 「歡迎光臨」。 $名稱;'。 –