Jump to content

DasHaas

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Everything posted by DasHaas

  1. I cannot seem to send the from header to change the recipient. Im not sure if it has anything to do with the host settings but it just displays the domain name as the sender. Here are my current headers $to = "a@2.com"; $subject = 'ABD website contact message'; $body = "$new_msg"; //HTML mail headers $headers .= 'MIME-Version: 1.0'.$eol; $headers .= 'Content-type: text/html; charset=iso-8859-1' .$eol; //Other headers $headers .= 'From: John Doe <4@5.com>'.$eol; $headers .= "Reply-To:".$name."<".$email.">".$eol; $headers .= "CC: 2@3.com".$eol;
  2. Im fairly new to php but I am able to write scripts and I can decipher advanced php scripts. There is one area that is pretty vague to me, email headers. Can someone please help me understand what the non obvious headers do Reply-to, CC and BCC are pretty self explanatory but I have seen others that Im hoping could help a problem im having with php mail. My problem is that some hosts (bellsouth.net) immediatly reject my emails, they don't even go into the spam folder, just nothing. Im hoping some of the advanced headers can help me with this.
  3. those variables are set in the include file, sorry I forgot to note that
  4. Hello all, I have a mail script that I am currently using and for the most part it seems to work well. In a nutshell it grabs the email addys from a MYSQL table and emails all the recipients...so I thought. My two personal emails are in the table (gmail & bellsouth.net) I get the emails with my gmail account but nothing in my bellsouth.net account. I looked in the spam folder and nothing. I wonder how many people in my table are not getting my emails? Can anyone help shed some light on this as well as some pointers to optimize my script. here is my script, I omitted the connection for its not really necessary. <?php // includes include('includes/PXS_Conf.php'); // open database connection $connection = mysql_connect($host, $user, $pass) or die ('Unable to connect to MySql server!'); // select database mysql_select_db($db) or die ('Unable to select database!'); $sql_state = mysql_query("SELECT state FROM PXS_Newsletter WHERE verified = 1 GROUP BY state") or die (mysql_error()); $sql_gender = mysql_query("SELECT gender FROM PXS_Newsletter WHERE verified = 1 GROUP BY gender") or die (mysql_error()); // form not yet submitted // display initial form if (!$_POST['submit']) { ?> <table cellpadding="5" cellspacing="5" class="table1"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <tr> <tr> <td valign="top" class="text5">Subject</td> <td><input name="txtsubject" type="text" class="table2" id="txtsubject" size="50" maxlength="250"></td> </tr> <tr> <td valign="top" class="text5">Email Body</td> <td valign="top" class="text5"><textarea name="txtbody" cols="47" rows="10" class="table2" id="txtbody"></textarea></td> </tr> <tr> <td colspan="2" valign="top" class="text5"><input name="submit" type="submit" id="submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td> </tr> </form> </table> <?php } else { // set up error list array $errorList = array(); $msgsubject = $_POST['txtsubject']; $msgbody = $_POST['txtbody']; $state = trim($_POST['ssl_state']); $gender = trim($_POST['ssl_gender']); // validate text input fields if (trim($_POST['txtsubject']) == '') {$errorList[] = 'Invalid entry: Message Subject';} if (trim($_POST['txtbody']) == '') {$errorList[] = "Invalid entry: Message Body";} // check for errors // if none found... if (sizeof($errorList) == 0) { // generate and execute query $query = mysql_query("SELECT email FROM PXS_Newsletter WHERE verified = 1") or die (mysql_error()); while($row = mysql_fetch_row($query)){ $email = $row[0]; // send email $headers = "Reply-To:".$fromname."<".$fromaddress.">".$eol; mail($email, $msgsubject, $msgbody, $headers);} // print result echo '<center><span class="text6">Message sent!</span></center>'; // close database connection mysql_close($connection); } else { // errors found // print as list echo 'The following errors were encountered:'; echo '<br>'; echo '<ul>'; for ($x=0; $x<sizeof($errorList); $x++) { echo "<li>$errorList[$x]"; } echo '</ul>'; } } ?>
  5. Im able to populate the list menu with the unique values, its sending the emails to the selected groups that im having a problem with.
  6. I have a form that emails all the subscribers in my MYSQL database. I would like to be able to filter the people I contact i.e. all males in FL, etc. That part I have down but when I start looking at all the possible combinations I get a little lost. Here is my code as you can see my sql statement is looking for a values in the where clauses, what should the value be if I select the all states or all genders options, or a combination of both (all females in CO)? Im thinking that I have to write a sql query for every possible combination but there has to be an easier way especially if I add more filters like city, country, etc. <?php // includes include('includes/PXS_Conf.php'); // open database connection $connection = mysql_connect($host, $user, $pass) or die ('Unable to connect to MySql server.'); // select database mysql_select_db($db) or die ('Unable to select database.'); $sql_state = mysql_query("SELECT state FROM PXS_Newsletter WHERE verified = 1 GROUP BY state") or die (mysql_error()); $sql_gender = mysql_query("SELECT gender FROM PXS_Newsletter WHERE verified = 1 GROUP BY gender") or die (mysql_error()); // form not yet submitted // display initial form if (!$_POST['submit']) { ?> <table cellpadding="5" cellspacing="5" class="table1"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <tr> <td valign="top" class="text5">State</td> <td> <?php echo "<select name='ssl_state'>"; echo "<option value='0' selected>Please select a state</option>"; echo "<option value='1'>Select all states</option>"; if(mysql_num_rows($sql_state)) { while($row = mysql_fetch_assoc($sql_state)) { echo "<option value = '$row[state]'>$row[state]</option>"; } } else { echo "<option>No states present</option>"; } ?> </td> </tr> <tr> <td valign="top" class="text5">Gender</td> <td> <?php echo "<select name='ssl_gender'>"; echo "<option value='0' selected>Please select a gender</option>"; echo "<option value='1'>Select all genders</option>"; if(mysql_num_rows($sql_gender)) { while($row = mysql_fetch_assoc($sql_gender)) { echo "<option value = '$row[gender]'>$row[gender]</option>"; } } else { echo "<option>No genders present</option>"; } ?> </td> <tr> <tr> <td valign="top" class="text5">Subject</td> <td><input name="txtsubject" type="text" class="table2" id="txtsubject" size="50" maxlength="250"></td> </tr> <tr> <td valign="top" class="text5">Email Body</td> <td valign="top" class="text5"><textarea name="txtbody" cols="47" rows="10" class="table2" id="txtbody"></textarea></td> </tr> <tr> <td colspan="2" valign="top" class="text5"><input name="submit" type="submit" id="submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td> </tr> </form> </table> <?php } else { // set up error list array $errorList = array(); $msgsubject = $_POST['txtsubject']; $msgbody = $_POST['txtbody']; $state = trim($_POST['ssl_state']); $gender = trim($_POST['ssl_gender']); // validate text input fields if (trim($_POST['txtsubject']) == '') {$errorList[] = 'Invalid entry: Message Subject';} if (trim($_POST['txtbody']) == '') {$errorList[] = "Invalid entry: Message Body";} if ($_POST['ssl_state'] == '0') {$errorList[] = "Please select a state";} if ($_POST['ssl_gender'] == '0') {$errorList[] = "Please select a gender";} // check for errors // if none found... if (sizeof($errorList) == 0) { // generate and execute query $query = mysql_query("SELECT email FROM PXS_Newsletter WHERE state = $state AND gender = $gender AND verified = 1") or die (mysql_error()); while($row = mysql_fetch_row($query)){ $email = $row[0]; // send email $headers = "Reply-To:".$fromname."<".$fromaddress.">".$eol; mail($email, $msgsubject, $msgbody, $headers);} // print result echo '<center><span class="text6">Message sent!</span></center>'; Thanks in advance, any help would be greatly appreciated
  7. thanks a million for all your help, your a life saver!!
  8. thanks, that worked. Why would I need to do that on this server, but other servers can process everything in one page?
  9. here is what i get when i submit the form that edits the record in the table.
  10. sorry the error is "Server cannot be found" I have used this script with other hosts and it has worked like a champ. the only difference with this host is that i had to use localhost instead of mysql.server.com
  11. thanks, im stumped. i gave the login full rights to the table but i can only delete and view data not add or edit. any suggestions?
  12. is this the best/only way to connect to a mysql db? $connection = mysql_connect($host, $user, $pass) or die ('Unable to connect to MySql server!');
  13. i use the same id/pw that gets me into phpMyAdmin in my script. the following script populates the text fields with the table data but when i make a change and submit the for after a second or so I get the "page cannot be found" error. <html> <head> <link href="css/StyleSheet1.css" rel="stylesheet" type="text/css"> <body> <!-- standard page header begins --> <table width="100%" class="table1"> <tr> <td><div align="center" class="text2">EDIT NEWS ARTICLE</div></td> </tr> </table> <br> <!-- standard page header ends --> <?php // includes include('includes/PXS_Conf.php'); include('includes/PXS_Functions.php'); // form not yet submitted // display initial form with values pre-filled if (!$_POST['submit']) { // check for record ID if ((!isset($_GET['id']) || trim($_GET['id']) == '')) { die('Missing record ID!'); } // open database connection $connection = mysql_connect($host, $user, $pass) or die ('Unable to connect to MySql server!'); // select database mysql_select_db($db) or die ('Unable to select database!'); // generate and execute query $id = $_GET['id']; $query = "SELECT Title, Content FROM PXS_News WHERE id = '$id'"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); // if a result is returned if (mysql_num_rows($result) > 0) { // turn it into an object $row = mysql_fetch_object($result); // print form with values pre-filled ?> <table cellpadding="5" cellspacing="5" class="table1"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <input type="hidden" name="id" value="<?php echo $id; ?>"> <tr> <td valign="top"><b class="text5">Title</b></td> <td> <input name="Title" type="text" class="table2" id="Title" value="<?php echo $row->Title; ?>" size="50" maxlength="250"> </td> </tr> <tr> <td valign="top"><b class="text5">Content</b></td> <td> <textarea name="Content" cols="47" rows="10" class="table2" id="Content"><?php echo $row->Content; ?></textarea> </td> </tr> <tr> <td colspan=2> <input type="Submit" name="submit" value="Update"> </td> </tr> </form> </table> <?php } // no result returned // print graceful error message else { echo 'That news article could not be located in the database'; } } // form submitted // start processing it else { // set up error list array $errorList = array(); $title = ucfirst($_POST['Title']); $content = ucfirst($_POST['Content']); $id = $_POST['id']; // check for record ID if ((!isset($_POST['id']) || trim($_POST['id']) == '')) { die ('Missing record ID!'); } // validate text input fields if (trim($_POST['Title']) == '') { $errorList[] = 'Please enter an article title'; } if (trim($_POST['Content']) == '') { $errorList[] = "Please enter article content"; } // check for errors // if none found... if (sizeof($errorList) == 0) { // generate and execute query $query = "UPDATE PXS_News SET Title = '$title', Content = '$Content' WHERE id = '$id'"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); // close database connection mysql_close($connection); // print result echo '<center><a href=PXS_ListNews.php>Update successful click here to go back to the article list</a></center>'; } else { // errors occurred // print as list echo 'The following errors were encountered:'; echo '<br>'; echo '<ul>'; for ($x=0; $x<sizeof($errorList); $x++) { echo "<li>$errorList[$x]"; } echo '</ul>'; } } ?> <!-- standard page footer begins --> <br> <table width="100%" class="table1"> <tr> <td><div align="center" class="text1"><font size="2">Copyright © 2006 All Rights Reserved </font></div></td> </tr> </table> <!-- standard page footer ends --> </body> </html>
  14. Im working on a database hosted by ipowerweb and I am having problems interacting with the database. I can view the data in the tables, delete the data, but I cant edit the data or add new data from my php form. I have used this script on other servers and it has worked like a champ. I called the host's tech support line and after 20 minutes of waiting they are saying its my script that has the problem. Im not an expert php programmer but this script works fine on my site that is hosted by another company. I gave the login im using full access to the database, but I still cant edit or add data to the table. Any suggestions?? :'(
  15. I am trying to keep the banned words in a table in my database so I do not have to maintain an array for each form. I think that eventually the list of words will be long. I want to run this check before I enter the data to the table. If the string does not contain banned words enter the data, if it contains banned words echo an error. I know how to do the if statement, I just do not know how to have php check my txt field against the words in my table that contains the banned words.
  16. I have a table that contains one column (words) this column has several rows, each contains a banned word. I want to check if one of the fields in my form contains one of these banned words, if it does halt everything and print an error. here is what i have so far, but it does not seem to work connect to database //check for banned words $query = "SELECT* FROM BannedWords"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); $row = mysql_fetch_array($result); if(substr_count("$long_desc","$row")>0) {echo 'BANNED WORD DETECTED';} any suggestions?? ???
  17. i tried: if (isset($_FILES['file'])) {$errorList[] = "Please select a file to upload";} but it gave me an error even when i selected a file
  18. I have the following code that validates my form fields. I have a file field called file that I cant figure out how to validate. Any help will be greatly appreciated my code <?php // validate text input fields an check password if (trim($_POST['txtname']) == '') {$errorList[] = 'Please enter your name';} if (trim($_POST['txtemail']) == '') {$errorList[] = "Please enter your email address";} if (trim($_POST['txtphone']) == '') {$errorList[] = "Please enter your phone number";} if (trim($_POST['txtpassword']) == '') {$errorList[] = "Please enter a password";} if (trim($_POST['txtpassword1']) == '') {$errorList[] = "Please re-enter your password";} if (trim($_POST['sslimpressions']) == '') {$errorList[] = "Please select a number of impressions";} if (trim($_POST['ssladtype']) == '') {$errorList[] = "Please select ad type";} if (trim($_POST['txturl']) == '') {$errorList[] = "Please enter your website url";} if (trim($_POST['txtalt']) == '') {$errorList[] = "Please enter your business name";} if ($_POST['txtpassword'] != $_POST['txtpassword1']) {$errorList[] = "Passwords did not match";} if($_FILES['file']['size'] > 3000000) {$errorList[] = "Selected file is too large";} ?> i tried using: if($_FILES['file']['size'] = 0) {$errorList[] = "Please select a file";} but it did not work, it let me submit the form
  19. $target_path = "images/"; $target_path = $target_path . basename( $_FILES['file']['txtname']); move_uploaded_file($_FILES['file']['name'], $target_path); This is the form <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <tr> <td width="234" valign="top" class="text5"><div align="right" class="form_text">Your name</div></td> <td width="227"><input name="txtname" type="text" id="txtname" /></td> </tr> <tr> <td valign="top" class="text5"><div align="right"><span class="form_text">email address</span> <div class="form_text_desc">We fight spam</div> </div></td> <td><input name="txtemail" type="text" id="txtemail" /></td> </tr> <tr> <td valign="top" class="text5"><div align="right" class="form_text">phone number </div></td> <td><input name="txtphone" type="text" id="txtphone" maxlength="10" /></td> </tr> <tr> <td><div align="right"><span class="form_text">password </span> <div class="form_text_desc">Make it strong!</div> </div></td> <td><input name="txtpassword" type="password" id="txtpassword" maxlength="7" /></td> </tr> <tr> <td><div align="right"><span class="form_text">confirm password </span> <div class="form_text_desc">Really strong...</div> </div></td> <td><input name="txtpassword1" type="password" id="txtpassword1" maxlength="7" /></td> </tr> <tr> <td><div align="right" class="form_text"> impressions </div></td> <td><select name="sslimpressions" id="sslimpressions"> <option>number of impressions</option> <option value="5000">5,000</option> <option value="10000">10,000</option> <option value="15000">15,000</option> <option value="20000">20,000</option> </select></td> </tr> <tr> <td><div align="right"><span class="form_text">type </span> <div class="form_text_desc">Body = 200x249 | Header = 468x60</div> </div></td> <td><select name="ssladtype" id="ssladtype"> <option>select ad size</option> <option value="1">header ad</option> <option value="2">body ad</option> </select></td> </tr> <tr> <td><div align="right" class="form_text">upload image<span class="form_text_desc"><br /> .GIF, .JPG only, 300k max </span><br /> </div></td> <td><input type="file" name="file" /></td> </tr> <tr> <td><div align="right"><span class="form_text">your website url<br /> </span><span class="form_text_desc">i.e. http://www.yoursite.com</span> </div> </div></td> <td><input name="txturl" type="text" id="txturl" /></td> </tr> <tr> <td><div align="right"><span class="form_text">image description</span> <div class="form_text_desc">i.e YOUR COMPANY NAME ...</div> </div></td> <td><input name="txtalt" type="text" id="txtalt" /></td> </tr> <tr> <td colspan="2"><div align="center"> <input type="submit" name="submit" value="Add" /> <input type="reset" name="Reset" value="Reset" /> </div></td> </tr> </form>
  20. <?php // form not yet submitted // display initial form if (!$_POST['submit']) { ?> <table width="484" cellpadding="3" cellspacing="3" class="table1"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <tr> <td width="199" valign="top" class="text5"><div align="right" class="form_text">name</div></td> <td width="262"><input name="txtname" type="text" id="txtname" /></td> </tr> <tr> <td valign="top" class="text5"><div align="right"><span class="form_text">email address</span> <div class="form_text_desc">We fight spam.</div> </div></td> <td><input name="txtemail" type="text" id="txtemail" /></td> </tr> <tr> <td valign="top" class="text5"><div align="right" class="form_text">phone number </div></td> <td><input name="txtphone" type="text" id="txtphone" maxlength="10" /></td> </tr> <tr> <td><div align="right"><span class="form_text">password </span> <div class="form_text_desc">Make it strong!</div> </div></td> <td><input name="txtpassword" type="password" id="txtpassword" maxlength="7" /></td> </tr> <tr> <td><div align="right"><span class="form_text">confirm password </span> <div class="form_text_desc">Really strong...</div> </div></td> <td><input name="txtpassword1" type="password" id="txtpassword1" maxlength="7" /></td> </tr> <tr> <td><div align="right" class="form_text">number of impressions </div></td> <td><select name="sslimpressions" id="sslimpressions"> <option>number of impressions</option> <option value="5000">5,000</option> <option value="10000">10,000</option> <option value="15000">15,000</option> <option value="20000">20,000</option> </select></td> </tr> <tr> <td><div align="right"><span class="form_text">ad type </span> <div class="form_text_desc">Body = 200x249 | Header = 134x23</div> </div></td> <td><select name="ssladtype" id="ssladtype"> <option>select ad size</option> <option value="1">header ad</option> <option value="2">body ad</option> </select></td> </tr> <tr> <td><div align="right" class="form_text">upload image<span class="form_text_desc"><br /> .GIF, .JPG only, 300k max </span><br /> </div></td> <td><input type="file" name="file" /></td> </tr> <tr> <td><div align="right"><span class="form_text">your website url </span> <div class="formexpl"><span class="form_text_desc">i.e. http://www.yoursite.com </span>.</div> </div></td> <td><input name="txturl" type="text" id="txturl" /></td> </tr> <tr> <td><div align="right"><span class="form_text">image description</span> <div class="form_text_desc">i.e YOUR NAME ...</div> </div></td> <td><input name="txtalt" type="text" id="txtalt" /></td> </tr> <tr> <td colspan="2"><div align="center"> <input type="submit" name="submit" value="Add" /> <input type="reset" name="Reset" value="Reset" /> </div></td> </tr> </form> </table> <?php } else { // includes include('includes/PXS_Conf.php'); // set up error list array $errorList = array(); $name = ucfirst($_POST['txtname']); $email = ($_POST['txtemail']); $phone = ($_POST['txtphone']); $password = trim($_POST['txtpassword']); $password1 = trim($_POST['txtpassword1']); $impressions = ($_POST['sslimpressions']); $adtype = ($_POST['ssladtype']); $file = ($_FILES['file']); $url = ($_POST['txturl']); $alt = ucwords($_POST['txtalt']); // validate text input fields an check password if (trim($_POST['txtname']) == '') {$errorList[] = 'Please enter your name';} if (trim($_POST['txtemail']) == '') {$errorList[] = "Please enter your email address";} if (trim($_POST['txtphone']) == '') {$errorList[] = "Please enter your phone number";} if (trim($_POST['txtpassword']) == '') {$errorList[] = "Please enter a password";} if (trim($_POST['txtpassword1']) == '') {$errorList[] = "Please re-enter your password";} if (trim($_POST['sslimpressions']) == '') {$errorList[] = "Please select a number of impressions";} if (trim($_POST['ssladtype']) == '') {$errorList[] = "Please select ad type";} if (trim($_POST['file']) == '') {$errorList[] = "Please select an image to upload";} if (trim($_POST['txturl']) == '') {$errorList[] = "Please enter your website url";} if (trim($_POST['txtalt']) == '') {$errorList[] = "Please enter your business name";} if ($_POST['txtpassword'] != $_POST['txtpassword1']) {$errorList[] = "Passwords did not match";} // check for errors // if none found... if (sizeof($errorList) == 0) { //upload file to server $target_path = "images/"; $target_path = $target_path . basename( $_FILES['file']['txtname']); if(move_uploaded_file($_FILES['file']['name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";} // open database connection $connection = mysql_connect($host, $user, $pass) or die ('Unable to connect to MySql server!'); // select database mysql_select_db($db) or die ('Unable to select database'); // generate and execute query $query = "INSERT INTO PXS_Ads(href, src, alt, impressions_bought, impressions_left, ad_date, contact_name, contact_email, contact_phone, status, type, password) VALUES('$url','$uploadfile','$alt','$impressions','$impressions',NOW(),'$name','$email','$phone','0','$adtype','$password')"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); // close database connection mysql_close($connection);
  21. Well I tried the following and it did not work, I looked at the site you gave me but I had problems deciphering the code. It seems like they had some validating functions as well, I just need it to work first then I will try to add bells and whistles. I snagged this from another post but it does not work for me ???. $target_path = "images/"; $target_path = $target_path . basename( $_FILES['file']['name']); if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";} Im confused with the following parts: file - should this be the name of the upload field in my form? name - is this from the form? tmp_name - is this somthing i assign or is it the original name from the users pc
  22. I have a form that needs to perform different actions, insert validated data into my table, and upload a file to my server. I also need the file location to be inserted into one of the fields in my table. I got everything working except for the upload & insert file path part. Here is my code, any help would be greatly appreciated! <?php } else { // includes include('includes/PXS_Conf.php'); // set up error list array $errorList = array(); $name = ucfirst($_POST['txtname']); $email = ($_POST['txtemail']); $phone = ($_POST['txtphone']); $password = trim($_POST['txtpassword']); $password1 = trim($_POST['txtpassword1']); $impressions = ($_POST['sslimpressions']); $adtype = ($_POST['ssladtype']); $file = ($_POST['file']); $url = ($_POST['txturl']); $alt = ucwords($_POST['txtalt']); // validate text input fields if (trim($_POST['txtname']) == '') {$errorList[] = 'Please enter your name';} if (trim($_POST['txtemail']) == '') {$errorList[] = "Please enter your email address";} if (trim($_POST['txtphone']) == '') {$errorList[] = "Please enter your phone number";} if (trim($_POST['txtpassword']) == '') {$errorList[] = "Please enter a password";} if (trim($_POST['txtpassword1']) == '') {$errorList[] = "Please re-enter your password";} if (trim($_POST['sslimpressions']) == '') {$errorList[] = "Please select a number of impressions";} if (trim($_POST['ssladtype']) == '') {$errorList[] = "Please select ad type";} if (trim($_POST['file']) == '') {$errorList[] = "Please select an image to upload";} if (trim($_POST['txturl']) == '') {$errorList[] = "Please enter your website url";} if (trim($_POST['txtalt']) == '') {$errorList[] = "Please enter your business name";} if ($_POST['txtpassword'] != $_POST['txtpassword1']) {$errorList[] = "Passwords did not match";} // check for errors // if none found... if (sizeof($errorList) == 0) { // open database connection $connection = mysql_connect($host, $user, $pass) or die ('Unable to connect to MySql server!'); // select database mysql_select_db($db) or die ('Unable to select database'); // generate and execute query $query = "INSERT INTO PXS_Ads(href, src, alt, impressions_bought, impressions_left, ad_date, contact_name, contact_email, contact_phone, status, type, password) VALUES('$url','$file','$alt','$impressions','$impressions',NOW(),'$name','$email','$phone','0','$adtype','$password')"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); // close database connection mysql_close($connection); // print result echo '<center> Request subitted!<br /> We will be contacting you shortly<br /> <a href=index.php>Return to website</a> </center>'; } else { // errors found // print as list echo 'The following errors were encountered:'; echo '<br>'; echo '<ul>'; for ($x=0; $x<sizeof($errorList); $x++) { echo "<li>$errorList[$x]"; } echo '</ul>'; } } ?> ???Thanks in advance! ???
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.