Jump to content

MidOhioIT

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

Everything posted by MidOhioIT

  1. Does anyone know if there is a good way to capture errors like a SMTP timed out or a mysql timeout? I have a newsletter system that is fairly large (50,00 plus) and there are times where the server may have a hiccup or something and it would be nice if the code would catch the timeout, sleep for a minute and retry again instead of me keep checking and noticing that it stopped over an hour later.. I am just doing the standard: require_once ('class.phpmailer.php'); // read the database and get the emails.. $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "localhost"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication
  2. thank you for the help. There was a few minor typos but you put me on the right track. I am only posting this code and making that statement because I am marking this as resolved and the next person to read this can have the actual code that worked with no syntax or flaws. Thanks again $xmlfile = 'image_and_link.xml'; $xml = simplexml_load_file($xmlfile); $images = array(); foreach($xml->pic as $link) { $images[] = $link->image; $links[] = $link->link; }
  3. i dont want to remove the tags as much as I want to assign the string inside the first image tags to variable1 and inside the 2nd image tags to variable2 ect... does that make sense?
  4. Is there a way in php to read the following xml file and only parse out the string between the tags <image></image> as example and store in 3 variables. examples: $image1 = <image>http://www.buck.com/slideshow_images/sidesponsor1.jpg</image> (just inside the tags) $image2 = <image>http://www.buck.com/slideshow_images/sidesponsor2.jpg</image> (just inside the tags) $image3 = <image>http://www.buck.com/slideshow_images/sidesponsor3.jpg</image> (just inside the tags) <?xml version="1.0" encoding="utf-8" standalone="yes"?> <images> <pic> <image>http://www.buck.com/slideshow_images/sidesponsor1.jpg</image> <caption></caption> <link>http://www.wades.com</link> </pic> <pic> <image>http://www.buck.com/slideshow_images/sidesponsor2.jpg</image> <caption></caption> <link>http://www.facebook.com/pages/Bucom/164093073538?ref=ts</link> </pic> <pic> <image>http://www.buck.com/slideshow_images/sidesponsor3.jpg</image> <caption></caption> <link>http://www.carnohio.com/</link> </pic> </images>
  5. I have a newsletter system that is coded with php to mysql. It is trying to do almost 60,000 emails. Everything works fine except at around 2,000 emails which is around 2-3 hours worth of processing the script always seems to stop running. is there a setting or a command that I can run to keep it running until the end? I can provide the code if needed but thought maybe it is a simple comand i can just insert (i hope)
  6. I am writing a newsletter system that is dealing with around 60,000 emails. Does anyone know if it would be less CPU usage to just loop through the mysql records or to put all records in an array from the db then read out of it?
  7. ok, assuming your talking about a select statement since your saying "It doesn't shows me the league address". what is your select statement? where is it in the code so I can look at it and understand what exactly is not working for you?
  8. You still have not specified, what is the name of the cursor your tring to fetch from?
  9. adrock, I am not sure he is talking about the delete statement, there is a select statement in there too. Miniu, can you be more clear on what sql statement your having problems with?
  10. in your fetch for $result I dont see where your taking the row and assigning it to any variable. I usually do something like this: while($row = mysql_fetch_object($result)) { $id = $row["seq_id"]; } Then just use $id as a normal variable. if your doing this I didnt see it... also food for thought... there are some instances your using tags <?php ?> and also <? ?> you should just stick to the new style and only use one style, makes it easy to read and if im not mistaken the new version of php likes <?php ?> anyways.. another thing to make sure of is run your query on the database to make sure you have actual results. you can also use the die function and it would let you know if you have a syntax error
  11. teamatomic , thank you for your help.. I got it to work as you sugguested. much appriciated!
  12. I dont think this is helping... 1) all i need to do looking at the html is strip the final tags: </body></html> 2) and then put some links in like <a href="http://www.website.com>Click here</a> 3) Put the tags back so now the links are in the body: <a href="http://www.website.com>Click here</a> </body> </html> Here is how the code is getting the html from the text area now...: $newsletter_body = $_SESSION["newsletter_body"]; inside the variable newsletter_body is the entire html code i posted, so now i need to strip only the last 2 tags so i can put my links in it and then put them back. I hope this makes sence.
  13. as long as your inside your form tags and php tags you could just do an echo if you want to keep it in php: echo '<input type="checkbox" value="Adventure" /> Adventure</li>';
  14. The issue.. We are developing an html newsletter. The client is creating an entire Html page as shown below. A requirement for the newsletter is to provide an opt out list link at the bottom of the newsletter when it goes out. We provided a form with text area where they put in this html code and we capture it in a variable and then just make it the body of the newsletter email. The issue is since they are ending their html code the proper way: </body> </html> I can not just append any links to the end of it i dont believe. I was tring to find a way to just replace the end tags with "" and would append what i needed and then just add them back in. I cant do that becasue they are doing more instances of </html> tags then just the last one. is there a way to just strip it off the end? here is the full html code that is being sent through the form: <html> <head> <title>Spring Getaways</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> </html> <html> <head> </head> <body bgcolor="#FCFBE2" link="#000099" vlink="#3366CC" background-repeat: repeat-x;> <table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF"> <tr> <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF"> <tr> <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"><img src="../graphics/e_heading_spring10.jpg" alt="Spring Specials email header graphic" width="620" height="157"></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td align="left" valign="top"><table width="100%" align="center" cellpadding="8" bgcolor="#FFFFFF"> <tr> <td height="50" colspan="3" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="8"> <tr> <td colspan="2" align="left" valign="top"><table width="175" border="0" align="right" cellpadding="0" cellspacing="0"> <tr> <td> </td> <td width="150"><font color="#000000" size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong><img src="../graphics/family_cutout.jpg" alt="Photo of a family in front of the lodge" width="150" height="132" border="1" align="right"></strong></font></td> </tr> </table> <p><font color="#000000" size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Spring Getaways at Resort</strong></font><br> <font size="1" face="Verdana, Arial, Helvetica, sans-serif">Enjoy overnight accommodations at the 271-room <a href="http://www.website.com/lodge.htm">Wilson Lodge</a></font> </p> <table width="50" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td width="20"><a href="http://www.facebook.com/Resortresort" target="_blank"><img src="http://www.website.com/graphics/facebook_16.png" alt="Link to Facebook page" width="16" height="16" border="0" align="left"></a></td> <td width="20"><a href="http://twitter.com/ResortResort" target="_blank"><img src="http://www.website.com/graphics/twitter_16.png" alt="Link to Twitter page." width="16" height="16" border="0" align="left"></a></td> </tr> </table> <p><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><font size="2">NEW! Socialize with Us! </font></strong></font><br> <font size="1" face="Verdana, Arial, Helvetica, sans-serif">Make sure to stay connected with all that is happening at Resort. Join our communities on Facebook and Twitter for regular updates and upcoming specials and become part of the tradition that makes Resort Resort and Conference Center so special. </font></p> </td> </tr> </table> <hr align="left" size="1" noshade></td> </tr> <tr> </tr> <tr> <td colspan="3" align="left" valign="top"></td> </tr> <tr> <td colspan="3" align="left" valign="top"><table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF"> <tr> <td bgcolor="#7165AD"><FONT color="#FFFFFF" SIZE="3" face="Verdana, Arial, Helvetica, sans-serif" class="large_white_text"><B>Spring Alive </B><font color="#EAF3C5" size="2"><strong>A beautiful, relaxing time for a getaway!</strong></font></FONT></td> </tr> <tr> <td align="left" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="105" align="left" valign="middle"><img src="http://www.website.com/graphics/icon_spring.jpg" alt="Spring Alive Package icon" width="90" height="90" border="1" align="left" class="body_copy"></td> <td align="left" valign="middle"><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" align="left" valign="middle"><b class="large_black_text"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://www.website.com/smsworld/wc.dll?smsworld~availbox" target="_blank"></a></font></strong><a href="https://reservation.website.com/V1WebControls/ResvDates.aspx" target="_blank"><img src="http://www.website.com/graphics/book_now_purple.jpg" alt="Link to reservations page" width="79" height="65" border="0" align="right"></a><strong><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Starting at $145*</font></strong></font></b><font face="Verdana, Arial, Helvetica, sans-serif"><br> <strong><font size="2">Weekdays (Sun-Thurs)<br> Available April 3 - May 21, 2009 Only</font></strong><br> <em><font size="1">Excluding holidays & special weekends <br> * Double Occupancy. Plus tax. Per Night Package Code: SPFL</font></em></span></font></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td bgcolor="#ADA6D0"><table width="200" border="0" cellspacing="0" cellpadding="2"> <tr> <td><strong><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">Package includes:</font></strong></td> </tr> </table></td> </tr> <tr> <td align="left" valign="middle" bgcolor="#F1F8DA"><table width="100%" border="0" cellspacing="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td width="2%" align="left" valign="top" class="body_copy"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">•</font></td> <td width="98%" align="left" valign="top" class="body_copy"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Overnight Accommodations at Wilson Lodge </font></td> </tr> <tr> <td align="left" valign="top" class="body_copy"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">•</font></td> <td align="left" valign="top" class="body_copy"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Mountaineer Buffet Breakfast</font></td> </tr> <tr> <td align="left" valign="top" class="body_copy"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">•</font></td> <td align="left" valign="top" class="body_copy"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Unlimited Use of Indoor Pool, Jacuzzi & Fitness Center</font></td> </tr> </table></td> </tr> </table></td> </tr> <tr> </tr> </table></td> </tr> <tr> </tr> <tr> <td colspan="3" align="left" valign="top"><table width="100%" border="1" cellpadding="5" cellspacing="0" bordercolor="#000000" bgcolor="#CC6633"> <tr> <td bgcolor="#E4F7A8"><p align="center"><strong><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Many other packages available! Call 800-624-6988 or visit our <a href="http://www.website.com" target="_blank">web site</a>.</font> </strong></p> <p><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">1,700-acre Resort features: </font></strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">271-room Wilson Lodge, Casual & Fine Dining, Spa, 54 Cottages, Ski & Snowboard Area, 72 Holes of Golf, Specialty Shops, Gardens, Good Zoo & Benedum Planetarium, Mansion Museum, Glass Museum, Indoor & Outdoor Pools, Tennis, Fishing, Stables, Miniature Golf, Environmental Center, Pedal Boating and a Resort Shuttle.</font></p></td> </tr> </table></td> </tr> <tr> <td height="20" colspan="3" align="left" valign="top"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Keep Resort e-mails coming! Add marketing@website.com to your address book now. If you are unable to view this message go to <a href="http://www.website.com/emails/spring_getaway0310.html"><font color="#006600">http://www.website.com/emails/spring_getaway0310.html</font></a>. </font></div></td> </tr> </table></td> </tr> </table> </body> </html>
  15. I may be having a dumb attack.. I am not seeing the issue here... my link is this: <a href="permissions_admin.php?account_action=add"> For some reasson on the page it is not using the variable, not sure why... Here is what is in the url: permissions_admin.php?account_action=edit&sess_user=user2 I did a quick echo to see what was in them: <?php session_start(); echo "account_action is: $account_action<br>"; echo "account_user is: $sess_user<br>"; ?> The page says this: account_action is: account_user is: anyone know what im doing wrong?
  16. I was doing that prior and same issue was happening then also...
  17. I think my issue is being caused from using the explode function but not sure. I have a form that passes the variable $content $content = $_POST["content"]; to the following function: $mywords = explode('', $content); $finalstring = ''; foreach($mywords as $word) { if(strlen($finalstring) <= 1200) { $finalstring = $finalstring . ' ' . $word; } else { $finalstring = $finalstring . ' .'; break; } } This collects the info and sends to an email. If i put a hyperlink in the textarea that uses content: <a href='http://www.phpfreaks.com'>PHP Freaks</a> I get the following in the email which obvisoulsy does not work because of the "\": <a href=\'http://www.phpfreaks.com\'>PHP Freaks</a> any ideas would be helpful
  18. i figured it out.. you have to do the following function: $content=nl2br($_POST['content']);
  19. Thanks, but not exactly what I was saying. Let me try to explain differently. On the text area when I type the following: this is my first paragraph... This is my second paragraph... This is my thrid paragraph... I get this result in my email: this is my first paragraph... This is my second paragraph... This is my thrid paragraph... When I expect line breaks..
  20. I have a form that is being used for the start of a newsletter for my client to fill in. The form has a textbox that is being used for the subject and a textarea that I am using for the body of the email. The problem that I am having is when you type in the textarea and you hit enter to start a new paragraph, the code just reads everything in the textarea and does not start the new line like it appears it does in the textarea. Is there an easy way to read the variable and capture the fact that the enter button was hit to do a "<br>" for a new line?
  21. that makes since, thank you! I had to move where im doing the count to where im doing the sql since there are some instances that the sql will not run as it depends on a record set back from another sql first. I am not getting the errors now, thank you both...
  22. I was thinking of that but if there was an error wouldnt it show up when I get a valid record back also?
  23. when you say your inserted result is 0, do you mean into a database? If so can I see your sql statements?
  24. This may be simple I just may need another pair of eyes.. When i get records back the below code works just fine, when I get 0 rows back it shows the warning below. As you can see I tried to code for it and you can see that the code works as it echo's my message but I want the warning to go away Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in show_coupon_list.php on line 224 No Coupons for this Catogory or Business. Please let us know about the Category that displayed no results so we can contact businesses for you! $cat_coupons = mysql_query("SELECT a.business_name, a.seq_id, a.state, a.city FROM users a where a.seq_id = '$cat_coupons_seq_id'"); $cat_num=mysql_num_rows($cat_coupons); if ($cat_num > 0) { while ($row = mysql_fetch_array($cat_coupons)) { $business_name = $row["business_name"]; $business_id = $row["seq_id"]; $state = $row["state"]; $city = $row["city"]; echo"<tr> <td align = 'left'> <a href=show_coupon.php?business=".urlencode($business_name).">$business_name $city,$state </a></td> </tr>"; } } else echo"<tr> <td>No Coupons for this Catogory or Business. Please let us know about the Category that displayed no results so we can contact businesses for you! </td> </tr>";
×
×
  • 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.