By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

teach me, please!

P: n/a
I'm a begginer
using IIS(win2000server)+PHP+MySQL, I make very simple codes, one html and
three php files


and I pass the variables within codes by form with "method=post" .

when I connect my server, http://localhost/communicate.html and give any
values to variables.
Error messages apear!
"Notice: Undefined variable: name in E:\2003DATA\webtxt\exercise\쓰기.php on
line 14"

why this message apears !

please tell me the cause!
Jul 16 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
> "Notice: Undefined variable: name in
E:\2003DATA\webtxt\exercise\쓰기.php on line 14"

This means that in your code you were using a variable called name (on line
14 of your code) which does not exist, e.g.:

if ($name) // first time that $name appears!
// do something with $name
// Initialize the variable $name with some value
$name = "Some value";

Here, the if-line should trigger the "Undefined variable" notice. This does
not necessarily mean that there is something wrong. It is just a "reminder".
You can deliberately use an undefined variable, for instance when you test
if it exists or not. But it is always a good idea to assign a value to each
variable explicitly before using it in your code. For example, you could put
the line


before the above if-line. The reason is that some evil hacker could easily
send a variable $name with a value of his own choice to your script. See the
PHP doc for details (security section).

Greetings, Thomas

Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.