Page 1 of 1

I have no idea why there is an error.. please advice.

Posted: Mon Sep 21, 2009 11:38 pm
by Kian Wee
learn.php
----------
<?php
$input = $_POST['msg'];
echo "You said: $input";
?>


index.html
-----------
<form action="learn.php" method="post">
Enter your message: <input type="text" name"msg" size="30" />
<input type="submit" value="send" />
</form>


After i input words and send/submit. This error appears when i preview it in DW:
Notice: Undefined index: msg in C:\localhost\learn.php on line 11
You said:

Or it shows a blank page when I access the file in my folder.

Thanks alot.

Re: I have no idea why there is an error.. please advice.

Posted: Mon Sep 21, 2009 11:48 pm
by Griven
You forgot the equals sign between name and "msg".

Also, please wrap your code in the [ code ] tags. It makes it much more readable.

Re: I have no idea why there is an error.. please advice.

Posted: Tue Sep 22, 2009 9:09 am
by Kian Wee
ahh... my bad. Such a simple mistake.

Code: Select all

<?php

echo 'Thanks alot Griven.'

?>

Re: I have no idea why there is an error.. please advice.

Posted: Tue Sep 22, 2009 10:42 am
by jackpf
Try again?



:P