Jump to content

michael.davis

Members
  • Posts

    61
  • Joined

  • Last visited

Everything posted by michael.davis

  1. I understand your point. That makes a ton of sense. Did not realize that my code would show all the email addresses like that. I wonder how to ensure that they are BCC instead. Hmmmm Thanks for the help on the code. That looks like that will work!
  2. Hi Everyone! Thanks in advance for taking the time to review my post. I am pretty new to PHP so please excuse my ignorance. I am working a project for myself. I want to be able to send out newsletters to my customers and sponsors. I have written the code and here it is: <?php $subject = $_POST['subject']; $message = $_POST['message']; $email = "[email protected]"; $headers = "From: $email"; $email_list = file("elist.txt"); $total_emails = count($email_list); for ($counter=0; $counter<$total_emails; $counter++) { $email_list[$counter] = trim($email_list[$counter]); } $to = implode(",",$email_list); if ( mail($to,$subject,$message,$headers) ) { echo "The email has been sent!"; } else { echo "The email has failed!"; } ?> ----------------------------------------------------------------------------- In my elist.txt file - I have two fields. Name and email. Bubba|[email protected] Oohay|[email protected] If i leave the names out of this file, the email script works great! I want to leave the names in there and reference them in my email that I am sending out to be more personal. Can this be done and can you help? Thanks! Mike
  3. Perfect! Thanks
  4. When I try to sample the old text file...I am receiving a Resource ID3 return. I do not get the actual old table data back. Thoughts?
  5. Thanks for the tips and help. I am new to php so I am trying.
  6. <?php session_start(); $guide = $_POST['guide']; $lake = $_POST['lake']; $date = $_POST['date']; $time = $_POST['time']; $watertemp = $_POST['watertemp']; $waterconditions = $_POST['waterconditions']; $airtemp = $_POST['airtemp']; $weathercond = $_POST['weathercond']; $lures = $_POST['lures']; $depth = $_POST['depth']; $notes = $_POST['notes']; $text = " \n"; if ($guide == "" || $lake == "" || $date == "" || $time == "" || $watertemp == "" || $waterconditions == "" || $airtemp == "" || $weathercond == "" || $lures == "" || $depth == "" || $notes == "") { print "<p><font color=\"red\"><b>ERROR! You must enter all of the required fields! <a href = \"javascript:history.back()\">\n\n Back To Fishing Report Form</a> </b></font>\n"; exit; } //$date = date('l F d Y h:i:s A'); //echo date ('l F d Y h:i:s A'); $file = "2011_reports.txt"; $open = fopen($file, "a+"); $text = " \n"; $dash = "-"; $pipe = "|"; $space = " "; $timer = ":"; $comma = ", "; $deg = "°"; if ($guide == "Mike") { $guide = "images/staff/mike_tn.jpg"; } if ($guide == "Zane") { $guide = "images/staff/zane_tn.jpg"; } if ($guide == "Zach") { $guide = "images/staff/zane_tn.jpg"; } if ($lake == "ohl") { $lake = '<iframe width="200" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=old+hickory+lake&sll=37.0625,-95.677068&sspn=38.775203,79.013672&ie=UTF8&hq=&hnear=Old+Hickory+Lake&t=h&ll=36.281645,-86.562824&spn=0.020757,0.025578&z=13&iwloc=A&output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=old+hickory+lake&sll=37.0625,-95.677068&sspn=38.775203,79.013672&ie=UTF8&hq=&hnear=Old+Hickory+Lake&t=h&ll=36.281645,-86.562824&spn=0.020757,0.025578&z=13&iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>'; } if ($lake == "pp") { $lake = '<iframe width="200" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=percy+priest+lake&aq=&sll=36.281623,-86.562785&sspn=0.077216,0.154324&ie=UTF8&hq=&hnear=Percy+Priest+Lake&t=h&ll=36.156935,-86.617498&spn=0.01386,0.017252&z=14&iwloc=A&output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=percy+priest+lake&aq=&sll=36.281623,-86.562785&sspn=0.077216,0.154324&ie=UTF8&hq=&hnear=Percy+Priest+Lake&t=h&ll=36.156935,-86.617498&spn=0.01386,0.017252&z=14&iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>'; } if ($lake == "lb") { $lake = '<iframe width="200" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=lake+barkley&aq=&sll=36.150524,-86.61252&sspn=0.019336,0.038581&ie=UTF8&hq=&hnear=Lake+Barkley&t=h&ll=36.999262,-88.192749&spn=0.109677,0.136642&z=11&iwloc=A&output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=lake+barkley&aq=&sll=36.150524,-86.61252&sspn=0.019336,0.038581&ie=UTF8&hq=&hnear=Lake+Barkley&t=h&ll=36.999262,-88.192749&spn=0.109677,0.136642&z=11&iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>'; } if ($lake == "kl") { $lake = '<iframe width="200" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=kentucky+lake&aq=&sll=36.999487,-88.192541&sspn=0.305999,0.617294&ie=UTF8&hq=&hnear=Kentucky+Lake&t=h&ll=36.886211,-88.179016&spn=0.439359,0.54657&z=9&iwloc=A&output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=kentucky+lake&aq=&sll=36.999487,-88.192541&sspn=0.305999,0.617294&ie=UTF8&hq=&hnear=Kentucky+Lake&t=h&ll=36.886211,-88.179016&spn=0.439359,0.54657&z=9&iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>'; } //$event = stripslashes($event); $table = "<table width=100% border=1>"; $t1 = "<tr>"; $t2 = "<td rowspan=4>"; $t3 = "</td>"; $t4 = "<td>Date & Time:"; $t5 = "</td>"; $t6 = "</tr>"; $t7 = "<tr>"; $t8 = "<td>Water Temperature:"; $t9 = "</td>"; $t10 = "</tr>"; $t11 = "<tr>"; $t12 = "<td>Water Conditions:"; $t13 = "</td>"; $t14 = "</tr>"; $t15 = "<tr>"; $t16 = "<td>Weather Conditions:"; $t17 = "</td>"; $t18 = "</tr>"; $t19 = "<tr>"; $t20 = "<td rowspan=3>Lake"; $t21 = "</td>"; $t22 = "<td>Air Temperature:"; $t23 = "</td>"; $t24 = "</tr>"; $t25 = "<tr>"; $t26 = "<td>Lures Used:"; $t27 = "</td>"; $t28 = "</tr>"; $t29 = "<tr>"; $t30 = "<td>Depth:"; $t31 = "</td>"; $t32 = "</tr>"; $t33 = "<tr>"; $t34 = "<td colspan=2>Notes:"; $t35 = "</td>"; $t36 = "</tr>"; $endtable = "</table>"; $hr = "<hr>"; fwrite($open, $table); fwrite($open, $t1); fwrite($open, $t2); fwrite($open, $guide); fwrite($open, $t3); fwrite($open, $t4); fwrite($open, $date); fwrite($open, $dash); fwrite($open, $time); fwrite($open, $t5); fwrite($open, $t6); fwrite($open, $t7); fwrite($open, $t8); fwrite($open, $watertemp); fwrite($open, $deg); fwrite($open, $t9); fwrite($open, $t10); fwrite($open, $t11); fwrite($open, $t12); fwrite($open, $waterconditions); fwrite($open, $t13); fwrite($open, $t14); fwrite($open, $t15); fwrite($open, $t16); fwrite($open, $weathercond); fwrite($open, $t17); fwrite($open, $t18); fwrite($open, $t19); fwrite($open, $t20); fwrite($open, $lake); fwrite($open, $t21); fwrite($open, $t22); fwrite($open, $airtemp); fwrite($open, $deg); fwrite($open, $t23); fwrite($open, $t24); fwrite($open, $t25); fwrite($open, $t26); fwrite($open, $lures); fwrite($open, $t27); fwrite($open, $t28); fwrite($open, $t29); fwrite($open, $t30); fwrite($open, $depth); fwrite($open, $t31); fwrite($open, $t32); fwrite($open, $t33); fwrite($open, $t34); fwrite($open, $notes); fwrite($open, $t35); fwrite($open, $t36); fwrite($open, $endtable); fwrite($open, $hr); fwrite($open, $text); fclose($open); ?>
  7. Hi! Thank you in advance for the time and assistance. I am writing a form and some php code that writes to a text file. I have that accomplished. My issue is that my form that writes to the text file appends to the bottom of the text file and I need it reversed. The latest form entry needs to be on top... and then the older posts to follow. I have tried the w+ r+ and c+ but that is not doing it. Is there something that I am missing? I appreciate the assistance! Mike
  8. Hi! Again, thank you for you kind help on this! I did not even know that it was called web scrapping! Easy enough. Well here is what I have done to make things work on my end: <?php //old Hickory $deg = ('°'); $html = file_get_contents('http://www.fishingnotes.com/lakeinfo.php?id=27931'); preg_match('~Est Water Temperature.*?([\d]{1,2}).&?deg.*?<br><br>~', $html, $match); echo $match[1]; echo $deg; ?> Gonna add a few more features to color code temperatures. Should be fun. Thank you again. I really do appreciate your help on this. You have taught me a couple of things. Mike
  9. Well thank you! I appreciate your kind help. I was not intending you to write the code. I am a newby with php and I needed some help, thus I am grateful for. Have a great day! Mike
  10. Thanks for the help. This works well. I was checking other sites...and the format is different for each lake. Grrr... How about this link: http://www.fishingnotes.com/lakeinfo.php?id=27931 Thanks! Mike
  11. Hi! I am working on a web page running a php script to extract from another website water temperatures from around the area. I have been working on this for about a month, and dont know how to do this. Here is where I am trying to grab the data from: http://www.lrn.usace.army.mil/pao/lakeinfo/CEN.htm --------------------------------------------------------------------------------- This is the data I need to obtain: Fishing is reported to be fair. Bass are being caught on spinnerbaits, plastic worms and jigs. Some Crappie are being caught on jigs and minnows. Trout are being taken in the tailwater area. The lake elevation is 633.87 feet above mean sea level. The water temperature is 58.0 degrees on the surface, 50.0 degrees at 10 feet. Ensure all required safety equipment is onboard your boat and in workable condition. I am wanting to do this for a couple of other lakes with the same data format. Can anyone help? Thanks in advance! Mike
×
×
  • 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.