pneudralics Posted March 3, 2006 Share Posted March 3, 2006 I'm starting to learn php and trying to create a simple form. This is my html page:[code]<form action="handle_post.php" method="post">First Name: <input type"text" name="first_name" size="20" /><br />Last Name: <input type="text" name="last_name" size="20" /><br />Email Address: <input type="text" name="email" size="20" /><br />Posting: <textarea name="posting" rows="3" cols="30"></textarea><br /><input type="submit" name"submit" value="Send My Posting" /></form>[/code]This is my handle_post.php page:[code] <?php$first_name = "$first_name";$last_name = "$last_name";$posting = "$posting";$name = $first_name . ' ' . $last_name;echo "thank you, $name, for posting the following: <br /><p>$posting</p>";?>[/code]When I click the submit button it downloads instead of going to the php page. What did I do wrong? Thanks for helping this newbie out. Quote Link to comment Share on other sites More sharing options...
wickning1 Posted March 3, 2006 Share Posted March 3, 2006 Sounds like your web server isn't configured correctly. Apache needs to know to treat .php files differently from the rest. Check the PHP documentation for how to install correctly. Quote Link to comment Share on other sites More sharing options...
dcro2 Posted March 3, 2006 Share Posted March 3, 2006 Well, first, are you sure your server has PHP installed? You might want to check that before anything.And, second, are you using $_POST to get the values before this code?Thirdly, you don't need to do $var = "$var", that's just wasting milliseconds :P Quote Link to comment Share on other sites More sharing options...
pneudralics Posted March 3, 2006 Author Share Posted March 3, 2006 Thanks I figured out what it was. 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.