Jump to content

DasHaas

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Everything posted by DasHaas

  1. Im trying to run an insert statement that inserts the site name, url, and compiled html code to my mysql table. Needless to say it is not working and I'm sure its the compiled html field that is giving me problems. Here is my code, any help would be greatly appreciated :-\ $compurl = "<a href="http://$txturl" target="_blank">$txtname</>"; $query = "INSERT INTO PXS_Links(site_name, site_url, compiled_url) VALUES('$name', '$url','$compurl')"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); I dont think it likes the double quotes here is an example of what i want to put into the table: example: $name = 'Yahoo' $url = 'www.yahoo.com' $compurl should be <a href="http://www.yahoo.com" "_blank">Yahoo</>
  2. btherl seems to be away, can anyone else help me with this?
  3. What needs to change to get it to work?
  4. I would like to send the email to all the email addresses in my table. Thanks for your help btw
  5. I am workong on a script that sends an email to all the email addresses in one of the tables in my database. The email will be created in a form. Once i submit the form I want the script to send an email to each email address in my table. This is what i have thus far and when I submit the form I get the following error ???: sendmail: No recipients specified although -t option used here is my code: <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">Send Email to newsletter subscribers </div></td> </tr> </table> <!-- standard page header ends --> <?php // form not yet submitted // display initial form if (!$_POST['submit']) { ?> <br> <table cellpadding="5" cellspacing="5" class="table1"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <tr> <td valign="top" class="text5">Group</td> <td> </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><br> <br> <?php } else { // includes include('Includes/PXS_Conf.php'); // set up error list array $errorList = array(); $msgsubject = $_POST['txtsubject']; $msgbody = $_POST['txtbody']; // 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) { // open database connection $connection = mysql_connect($host, $user, $pass) or die ('Unable to connect to MySql server! Please contact PXS customer support.'); // select database mysql_select_db($db) or die ('Unable to select database! Please contact PXS customer support.'); // generate and execute query $query = "SELECT email FROM PXS_Newsletter WHERE verified = 1"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); // send email $To = $row['$result']; $Subject = "<".$msgsubject.">"; $Body = "<".$msgbody.">"; mail($To, $Subject, $Body); // print result echo '<center>Message sent</center>'; // close database connection mysql_close($connection); } else { // errors found // print as list echo '<font size=-1>The following errors were encountered:'; echo '<br>'; echo '<ul>'; for ($x=0; $x<sizeof($errorList); $x++) { echo "<li>$errorList[$x]"; } echo '</ul></font>'; } } ?> <!-- standard page footer begins --> <table width="100%" class="table1"> <tr> <td><div align="center" class="text1"> <div align="center">Copyright © 2006 Projekt-X-Studios. All Rights Reserved </div> </div></td> </tr> </table> </body> </html> Any help would be greatly appreciated :'(
×
×
  • 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.