Hey, thanks! Got the code to add something and the redirection working, but can't figure out how/where/what to do with the mail().
<?
}
else
{
// includes
include("config.php");
// set up error list array
$errorList = array();
$count = 0;
// validate text input fields
if (!$email) { $errorList[$count] = "Invalid entry: Email"; $count++; }
// check for errors
// if none found...
if (sizeof($errorList) == 0)
{
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$query = "INSERT INTO blog(email, blog) VALUES('$email', '$blog')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// print result
echo "Update successful. <a href='home.php'>Go back to the main menu</a>.</font>";
// close database connection
mysql_close($connection);
}
else
{
// errors found
// print as list
echo "<font size=-1>The following errors were encountered: <br>";
echo "<ul>";
for ($x=0; $x<sizeof($errorList); $x++)
{
echo "<li>$errorList[$x]";
}
echo "</ul></font>";
}
}
?>
What I want to do with the mail is send it to the address entered into the db for email, and message saying Thank you for blah, blah, this is the content you entered and have t he content they entered.