RLJ Posted September 29, 2010 Share Posted September 29, 2010 Hi, I have a simple html file as follows: <html> <body> <form method="GET" action="retrieve.php"> First Name: <input type="text" name="first_name" size="25" maxlength="25"> Last Name: <input type="text" name="last_name" size="25" maxlength="25"> <input type="submit" /> </form> </body> </html> that sends data to retrieve.php, which is as follows: <?php $first_name = GET["first_name"]; $last_name = GET["last_name"]; ?> very simple, I know, but I keep getting a parse error when I try to run it. Please help! I've tried all sorts of variations on the syntax, but nothing will work. It's probably a very stupid mistake I am making, but if someone sees it, please tell me! Many thanks. Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 29, 2010 Share Posted September 29, 2010 You are referencing the GET values incorrectly. You are missing the "$_". I would suggest also using trim(). $first_name = trim($_GET["first_name"]); $last_name = ($_GET["last_name"]); Quote Link to comment Share on other sites More sharing options...
RLJ Posted October 2, 2010 Author Share Posted October 2, 2010 Thanks! I must have been tired...... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.