I'm currently in the process of learning PHP. I have been trying to work with the $_POST function and forms. I am running the latest verision of PHP on BRS WebWeaver.
Here's what my code looks like on my html page called form.htm:
Code: Select all
<html>
<head></head>
<body>
<form action="message.php" method="post">
Enter your message: <input type="text" name="msg" size="30">
<input type="submit" value="Send">
</form>
</body>
</html>Code: Select all
<html>
<head></head>
<body>
<?php
// retrieve form data
$input = $_GET['msg'];
// use it
echo "You said: <i>$input</i>";
?>
</body>
</html>It seems to be a problem with the variable that is being used... I would think that it's not seeing the form by the name of "msg" on the form.htm file, and that's what's confusing it.You said: PHP Notice: Undefined index: msg in D:\PHP\message.php on line 7
Any suggestions?
Thanks in advance.
-mq