HI,php中的頁面之間的通信
我在php中寫了這段代碼。
<head>
<title>listent</title>
</head>
<body>
<form action="untitled 3.php">
<input type = "text" name = "user">
<br>
<textarea name = "address" rows = "10" cols = "40">
</textarea>
<br>
<input type = "submit" value = "heat it">
<br>
<select name="combobox" multiple[]>
<option>mehdi
<option>nine
</select>
</form>
</body>
</html>
現在當我點擊提交按鈕untitled 3.php
運行。
我寫
<?php
print "welcome $user";
?>
但它有錯誤。
Notice: Undefined variable: user in C:\xampp\htdocs\me\Untitled 3.php on line 4
welcome
什麼問題?我該如何解決它?
你真**在文件名「untitled 3.php」中有一個空格嗎? – 2011-05-07 20:35:48
是的,我擁有它。 – 2011-05-07 20:36:56
請參見[這是因爲(「全局」)變量在PHP中不是真正的全局變量。](http://stackoverflow.com/questions/1557787/are-global-variables-in-php-considered-bad-practice) – mario 2011-05-07 20:38:40