jstratos Posted February 11, 2009 Share Posted February 11, 2009 I have a simple SIGN-UP form which sends information to the mysql database TABLE named "UPDATES". I want to generate a form that will allow me to type in a message and then send it to ALL the email addresses stored in the TABLE "UPDATES" Here's my PHP: <?php include 'config.php' ?> <?php include 'opendb.php' ?> <?php // Form1 starts here $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO updates (name, email, address, city, state, zip, phone, comments) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['address'], "text"), GetSQLValueString($_POST['city'], "text"), GetSQLValueString($_POST['state'], "text"), GetSQLValueString($_POST['zip'], "text"), GetSQLValueString($_POST['phone'], "text"), GetSQLValueString($_POST['comments'], "text")); mysql_select_db(ABC_company); $Result1 = mysql_query($insertSQL) or die(mysql_error()); $insertGoTo = "../index.php?p=thanks"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> <html> BlaBlaBla </html> <?php include 'closedb.php' ?> I've looked around in your forum but can't seem to find anything 'simple'? Any one have anything? Quote Link to comment Share on other sites More sharing options...
jstratos Posted February 11, 2009 Author Share Posted February 11, 2009 I figured out how to do this... 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.