Okay I gotta keep this short because I'm pressed for time (do I cut the blue wire or the red?!) but this is just a tutorial on basic programs in
PHP. Yes, we're calling it a program, because it fits the description. Let's go.
First, make your index.
php file a form. Nothing fancy for now, you can do that on your own time. Here's the code you'll want to use:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Basic Program - Submission</title>
</head>
<body>
<form action="say.php" method="POST">
Your message: <br />
<textarea rows="10" cols="50" name="message">
Your message here.
</textarea>
</form>
</body>
</html>
Now we have our form set up, and as you saw in it, we want it to go to a file titled "say.
php" - however since this file hasn't been created yet, we're going to have to make it. Don't worry, it's a very simple
PHP script:
<?php
echo $_POST['message'];
echo "<br /><hr /><strong>Thanks for submitting your message.</strong>";
?> All this does is posts the information from the form and thanks you for your message. It's very simple, but it still does count as a "program" for what it does. And now, we're done.