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