Your form document and the page that reads the answers can be in one page or two seperate pages.
Your form can even be in a standard html page. Just use your form tags:
Code:
<form method='post' action='pagetoreadform.php'>
<input type="text" name="email" size="40" maxlength="50">
<input type="submit" name="submit" value="Submit">
</form>
Obviously you'd want some type of validation using Javascript and probably want to dress up your form appearance, but you can grab code off of any good site for that.
Now, to do something with the email address your form just captured..
Code:
<?php
$email = $_POST['email'];
$tablename = "your_db_tablename";
if(!empty($email)) {
$sql = "INSERT INTO $tablename (email) VALUES('$email')";
if (!mysql_select_db($dbname)) {
echo "<h3>No Connection!</h3>";
exit;
}
$result = mysql_query($sql)
or die("ack! query failed");
}
This, by necessity, leaves out the rather important steps of creating the database and table, connection and exception handling, etc., etc.
There are really no adequate short cuts to learning server side code. It tends to be a bit deeper and with more layers than client-side coding.
Now I'm not saying that client-side programming doesn't require plenty of studying - its just that you can copy and paste CSS/Javascript code and, if it works, forget about it. Not quite so with server-side. But its enjoyable and worth the study-time.