Jump to content
Larry Ullman's Book Forums

Recommended Posts

Yes im running these through xampp. 

 

 Html

<!DOCTYPE html

<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Forum Posting</title>
</head>
<body>
<div><p>Please complete this form to submit your posting:</p>
 
<form action="handle_post.php" method="post">
 
<p>First Name: <input type="text" name="first_name" size="20" /></p>
 
<p>Last Name: <input type="text" name="last_name" size="20" /></p>
 
<p>Email Address: <input type="text" name="email" size="30" /></p>
 
<p>Posting: <textarea name="posting" rows="9" cols="30"></textarea></p>
 
<input type="submit" name="submit" value="Send My Posting" />
 
</form>
</div>
</body>
</html>
 
PHP
 
<!DOCTYPE html 
<html  lang="en">
<head>
<meta  charset="utf-8"/>
<title>Forum Posting</title>
</head>
<body>
<?php 
 
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$posting = nl2br($_POST['posting']);
 
$name = $first_name . ' ' . $last_name;
 
print "<div>Thank you, $name, for your posting:
<p>$posting</p></div>";
 
?>
</body>
</html>
Link to comment
Share on other sites

ahhh got it to work like that. Thanks for your guys help. Btw this is a little off topic, but I am new to php and am currently reading the "php for the web 4th addition" Im having alot of trouble trying to remember all the functions they are throwing at me in the first few chapters. Do you guys have any tips to learning php?

Link to comment
Share on other sites

Glad you got it working.

 

As for learning PHP, all I can recommend is play with the code a lot.

That's really the only way to learn it well.

 

Almost always, if you do a Google search for "PHP" and the name of a PHP function, the first hit you will get is an explanation of how the function works on php.net, the official PHP web reference.

That site can be helpful for figuring out how functions work so you don't have to memorize everything.

 

My best advice though is to think of a project or something that you really want to make with PHP, and then do it.

You will learn a lot by just coding.

It's hard at first, no doubt, but you'll get used to it.

 

You can always come to these forums as well when you're stuck.

  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...