Jump to content

komquat

Members
  • Posts

    130
  • Joined

  • Last visited

    Never

Everything posted by komquat

  1. Thanks all.  This was an issue with my host, he currently fixed it and it is working correct, my php was correct!
  2. Where do I check my SMTP configurations?  You suggestion did not work, so it must be something with my set-up.
  3. Any thoughts on this one? Could it be in the INI file?  Thanks
  4. Any help on this would be great.  Thanks
  5. [code=php:0] //Who gets the mail $to = 'chris.hamel@andybourdeau.com';  //this works $to .= ', '; $to .= 'me@andybourdeau.com';  //works $to .= ', '; $to .= 'arbourde@chartermi.net'; // does not work $mail_message = "<table align='center' border='1'> <tr> <th>Week</th> <th>Race</th> <th>Track</th> <th>Driver</th> </tr>"; $mail_sql = "SELECT nascar_first.week AS week, nascar_schedule.race AS race, $dvalue AS mail_driver, nascar_schedule.track AS track FROM nascar_first, nascar_schedule WHERE nascar_first.week = nascar_schedule.sched_id ORDER BY nascar_first.fantasy_id "; $qry_mail = mysql_query($mail_sql, $connection) or die ("Could not get the proper info for Mail SQL"); while ($mail = mysql_fetch_array($qry_mail)) { $mail_week = $mail[week]; $mail_race = $mail[race]; $mail_track = $mail[track]; $mail_driver = $mail[mail_driver]; //Continue the display block $mail_message .= " <tr> <td align='center'>$mail_week</td> <td align='center'>$mail_race</td> <td align='center'>$mail_track</td> <td align='center'>$mail_driver</td> </tr>"; } $mail_message .= "</table>"; //Mail message Set up here $mailmsg = "<p align='center'>Second Half NASCAR Picks for $_SESSION[first_name]"; $mailmsg .= "<html> <title>Fantasy Nascar</title> <body>"; $mailmsg .= "<p align='center'>$mail_message</p> \n"; $mailmsg .= "</body></html>"; $subject = "Second Half NASCAR Picks for $_SESSION[first_name]"; $mailheaders  = 'MIME-Version: 1.0' . "\r\n"; $mailheaders .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $mailheaders .= "From: Fantasy Nascar"; mail($to, $subject, $mailmsg, $mailheaders); [/code]
  6. when using mail(), I am only able to send email to accounts that end in my own domain (andybourdeau.com)  I can not get it to work for all email Example:  it sends to me@andybourdeau.com but not to test@yahoo.com Help is appreciated Thanks in Advance
  7. If anyone is interested, I figured it out with MySQL! Here is the code: [code=php:0] $sql_next = "SELECT sched_id, race_date, track, race, (day(curdate()))-(day(race_date)) as diff FROM nascar_schedule WHERE month(curdate()) = month(race_date) and day(curdate()) <= day(race_date) and (day(curdate()))-(day(race_date)) >= '-7' ORDER BY sched_id "; [/code] Week Date Race Track 19. 2006-07-16 New England 300 New Hampshire International Sp 20. 2006-07-23 Pennsylvania 500 Pocono Raceway 21. 2008-06-06 Allstate 400 at the Brickyard Indianapolis Motor Speedway 22. 2006-08-13 Sirius Satellite Radio Watkins Glen International 23. 2006-08-20 GFS Marketplace 400 Michigan International Speedwa 24. 2006-08-26 Sharpie 500 Bristol Motor Speedway 25. 2006-09-03 Sony HD 500 California Speedway 26. 2006-09-09 Chevy Rock & Roll 400 Richmond International Raceway 27. 2006-09-17 Sylvania 300 New Hampshire International Sp 28. 2006-09-24 Dover 400 Dover International Speedway 29. 2006-10-01 Banquet 400 presented by ConAg Kansas Speedway 30. 2006-10-08 UAW-Ford 500 Talladega Superspeedway 31. 2006-10-14 Bank of America 500 Lowe's Motor Speedway [b]32. 2006-10-22 Subway 500 Martinsville Speedway [/b] 33. 2006-10-29 Bass Pro Shops MBNA 500 Atlanta Motor Speedway 34. 2006-11-05 Dickies 500 Texas Motor Speedway 35. 2006-11-12 Checker Auto Parts 500 Phoenix International Raceway 36. 2006-11-19 Ford 400 Homestead-Miami Speedway
  8. Anyone good with dates and things, please give a hand. Thanks in advance
  9. I am not good enough for aquick fix, I would do an intermediate page that tells them to use you button, or have the intermediate page ask if they are sure they want to start over when that happens?
  10. Put a button in to go back that will reset $_SESSION['form_step'] to what you want it to? May be a fix
  11. How do you want to display all the data?  In a table, list form? try:  [code=php:0]  $display = "<table><tr><th>Headers</th></tr>";     while ($row=$result){     $display .= "<tr><td>variables</td></tr>";    } display .="</table>"; [/code] Then insert the $display later when needed
  12. I think you forgot $result = mysql_query(query);
  13. No CGI Just use POST in your form Then what ever file you have it going to set up the php to input or update the DB <form method="post" action="where_ever.php"> Then on where_ever.php set up your connections and write the sql you want: $sql = "UPDATE table SET field = '$_POST[variable]' WHERE field2 = '$_POST[variable2]'";
  14. I am looking to highlight one line from the information I pull from a DB. The current format of the DB is 2006-02-19 I want to have a list of all dates and highlight the next one in the sequence according to today.  Ex Week Date Race Track 19. 2006-07-16 New England 300 New Hampshire International Sp 20. 2006-07-23 Pennsylvania 500 Pocono Raceway 21. 2008-06-06 Allstate 400 at the Brickyard Indianapolis Motor Speedway 22. 2006-08-13 Sirius Satellite Radio Watkins Glen International 23. 2006-08-20 GFS Marketplace 400 Michigan International Speedwa 24. 2006-08-26 Sharpie 500 Bristol Motor Speedway 25. 2006-09-03 Sony HD 500 California Speedway 26. 2006-09-09 Chevy Rock & Roll 400 Richmond International Raceway 27. 2006-09-17 Sylvania 300 New Hampshire International Sp 28. 2006-09-24 Dover 400 Dover International Speedway 29. 2006-10-01 Banquet 400 presented by ConAg Kansas Speedway 30. 2006-10-08 UAW-Ford 500 Talladega Superspeedway 31. 2006-10-14 Bank of America 500 Lowe's Motor Speedway 32. 2006-10-22 Subway 500 Martinsville Speedway 33. 2006-10-29 Bass Pro Shops MBNA 500 Atlanta Motor Speedway 34. 2006-11-05 Dickies 500 Texas Motor Speedway 35. 2006-11-12 Checker Auto Parts 500 Phoenix International Raceway 36. 2006-11-19 Ford 400 Homestead-Miami Speedway I want line 31 highlighted and the rest in normal text.  Please help thanks in advance
  15. How do I control session times, I would like some that never expire. Thanks
  16. Thank you!! I felt a bit like you sig!!!!!! ;D
  17. I know nothing about javascript, please link or show code thanks
  18. I need a quick help on how to set the focus to a specific field in my form? Thanks in advance
  19. Thanks to wildteen88 and mostly to ober who openned my eyes to the great command of "foreach" I was able to get it to work for all my items, with only 1 foreach statement Here is my working code!! [code=php:0] <? //Include Connection information include("include/connection.php"); //Get the Test id for new info $sql_get_id = "SELECT test_id FROM test_info WHERE test_name = '$_POST[test_name]' "; $qry_get_id = mysql_query($sql_get_id, $connection) or die ("Could not get the proper info"); while ($id= mysql_fetch_array($qry_get_id)) { $test_id = $id[test_id]; } $display_block .= "<br> <table border='1' cellspacing='1'> <tr> <th colspan='6' align='center'>Copper (Solids)</th> </tr> <tr> <td>&nbsp&nbspSample&nbsp&nbsp</td> <td>&nbsp&nbsp&nbsp&nbspWeight&nbsp&nbsp&nbsp&nbsp</td> <td>&nbsp&nbsp&nbsp&nbsp&nbspTare&nbsp&nbsp&nbsp&nbsp&nbsp</td> <td>&nbsp&nbsp&nbsp&nbsp&nbspPost&nbsp&nbsp&nbsp&nbsp&nbsp</td> <td>&nbsp&nbsp&nbsp&nbsp&nbspDiff.&nbsp&nbsp&nbsp&nbsp&nbsp</td> <td>Copper (%)</td> </tr>"; $i = 1; foreach ($_POST['cu_s_sample'] as $cu_example) { //Insert information in the correct table $sql_insert_cu_s = "INSERT INTO cu_s (test_id, cu_s_sample, cu_s_wt, cu_s_tare, cu_s_post) VALUES ('$test_id', '" . $cu_example . "', '" . $_POST[cu_s_wt][$i] . "', '" . $_POST[cu_s_tare][$i] . "', '" . $_POST[cu_s_post][$i] . "') "; //Run Query $qry_insert_cu_s = mysql_query($sql_insert_cu_s, $connection) or die ("Can not execute insert Query"); //Calculations for Copper Solids $cu_s_diff_value[$i] = $_POST[cu_s_post][$i] - $_POST[cu_s_tare][$i]; $diff_formatted[$i] = number_format($cu_s_diff_value[$i], 4); if ($_POST[cu_s_wt][$i] == '0' or $_POST[cu_s_wt][$i] == null){ $cu_per_formatted[$i] = "DIV/0"; } else { $cu_per_value[$i] = ($cu_s_diff_value[$i] / $_POST[cu_s_wt][$i]) * 100; $cu_per_formatted[$i] = number_format($cu_per_value[$i], 1); } $display_block .= " <tr> <td align='center'>" . $cu_example . "</td> <td align='center'>" . $_POST[cu_s_wt][$i] . "</td> <td align='center'>" . $_POST[cu_s_tare][$i] . "</td> <td align='center'>" . $_POST[cu_s_post][$i] . "</td> <td align='center'>" . $diff_formatted[$i] . "</td> <td align='center'>" . $cu_per_formatted[$i] . "</td> "; $i++; } $display_block .= "</table>"; ?> [/code] THANKS AGAIN, I love this site!!
  20. [quote author=wildteen88 link=topic=106253.msg424783#msg424783 date=1156951999] I cant see any code that is relvent to the code you posted in your first post. So I'm assuming the following is the code you are having difficulty with: [code=php:0] for ($i = 1; $i <= $_POST[cu_s_number]; $i++){ $display_block .= " <tr> <td align='center'>$cu_s_sample[$i]</td> <td align='center'>$cu_s_wt[$i]</td> <td align='center'>$cu_s_tare[$i]</td> <td align='center'>$cu_s_post[$i]</td> <td align='center'>$diff_formatted[$i]</td> <td align='center'>$cu_per_formatted[$i]</td> </tr>"; }[/code] is that the code you are having problems with. [/quote] Sorry about the code, I have many files that are very similar. Yes this is the code that I am concerned with. I was able to get you thing to work for 1 item, can I get all items at 1 time, cu_s_sample, cu_s_wt, cu_s_tare, cu_s_post at the same time? Also above in the code, I would like to write it to a table, [code=php:0] for ($i = 1; $i <= $cu_s_number; $i++){ //Insert information in the correct table $sql_insert_cu_s = "INSERT INTO cu_s (test_id, cu_s_sample, cu_s_wt, cu_s_tare, cu_s_post) VALUES ('$test_id', '$cu_s_sample[$i]', '$cu_s_wt[$i]', '$cu_s_tare[$i]', '$cu_s_post[$i]') "; //Run Query $qry_insert_cu_s = mysql_query($sql_insert_cu_s, $connection) or die ("Can not execute insert Query"); [/code] Again, thanks for all the help
  21. I am not sure in my code where it would go, so here is my whole code, and you point me in the direction of where the above code for $cu_s_sample should go [code=php:0] //Include Connection information include("include/connection.php"); //Get the Test id for new info $sql_get_id = "SELECT test_id FROM test_info WHERE test_name = '$_POST[test_name]' "; $qry_get_id = mysql_query($sql_get_id, $connection) or die ("Could not get the proper info"); while ($id= mysql_fetch_array($qry_get_id)) { $test_id = $id[test_id]; } for ($i = 1; $i <= $cu_s_number; $i++){ //Insert information in the correct table $sql_insert_cu_s = "INSERT INTO cu_s (test_id, cu_s_sample, cu_s_wt, cu_s_tare, cu_s_post) VALUES ('$test_id', '$cu_s_sample[$i]', '$cu_s_wt[$i]', '$cu_s_tare[$i]', '$cu_s_post[$i]') "; //Run Query $qry_insert_cu_s = mysql_query($sql_insert_cu_s, $connection) or die ("Can not execute insert Query"); //Calculations for Cu Liquids $cu_s_diff_value[$i] = $_POST[cu_s_post][$i] - $_POST[cu_s_tare][$i]; $diff_formatted[$i] = number_format($cu_s_diff_value[$i], 4); if ($_POST[cu_s_wt][$i] == '0' or $_POST[cu_s_wt][$i] == null){ $cu_per_formatted[$i] = "DIV/0"; } else { $cu_per_value[$i] = ($cu_s_diff_value[$i] / $_POST[cu_s_wt][$i]) * 100; $cu_per_formatted[$i] = number_format($cu_per_value[$i], 1); } } $display_block .= "<br> <table border='1' cellspacing='1'> <tr> <th colspan='6' align='center'>Copper (Solids)</th> </tr> <tr> <td>&nbsp&nbspSample&nbsp&nbsp</td> <td>&nbsp&nbsp&nbsp&nbspWeight&nbsp&nbsp&nbsp&nbsp</td> <td>&nbsp&nbsp&nbsp&nbsp&nbspTare&nbsp&nbsp&nbsp&nbsp&nbsp</td> <td>&nbsp&nbsp&nbsp&nbsp&nbspPost&nbsp&nbsp&nbsp&nbsp&nbsp</td> <td>&nbsp&nbsp&nbsp&nbsp&nbspDiff.&nbsp&nbsp&nbsp&nbsp&nbsp</td> <td>Copper (%)</td> </tr>"; for ($i = 1; $i <= $_POST[cu_s_number]; $i++){ $display_block .= " <tr> <td align='center'>$cu_s_sample[$i]</td> <td align='center'>$cu_s_wt[$i]</td> <td align='center'>$cu_s_tare[$i]</td> <td align='center'>$cu_s_post[$i]</td> <td align='center'>$diff_formatted[$i]</td> <td align='center'>$cu_per_formatted[$i]</td> </tr>"; } $display_block .= "</table>"; [/code] Thanks
  22. [quote author=wildteen88 link=topic=106253.msg424757#msg424757 date=1156950851] Run this code on co2_s_sample array: [code=php:0]echo "<pre>" . print_r($_POST['co2_s_sample '], true) . "</pre>";[/code] What do you get? That code should retrun whats in the array. Post what it retruns here. Also its a good job your host has upgraded PHP, as it should like it was using register_globals before. [/quote] Array (     [1] => 1     [2] => 54 ) That is what I want to display
  23. [quote author=wildteen88 link=topic=106253.msg424723#msg424723 date=1156949443] if $_POST[co2_s_sample] is an array you'll want to use $_POST[co2_s_sample][$i] to access the items in that array [/quote] The co2_s_sample coming from the first page is the array. When I first designed the page, I was able to get away with out the $_POST[var] command and only use $var[$i].  Now my web host redid my server and I no longer can do this, I have to use the $_POST command.  I am trying to rewrite all the code to work and am having a very hard time. I will look into the foreach command.  (Ober, I did not mean to get you worked up) Andy
  24. I am not familiar enough with the foreach command.  If there is a way to do it with out, I would like to pursue that first, if I can not get around it, I will become more familiar with the Foreach command. Any one out there have a way around with-out the foreach? Thanks
  25. I am using forms to bring data from 1 page to the next.  [code=php:0] for ($i = 1; $i <= $_POST[co2_s_number]; $i++){ $display_block .= " <tr> <td align='center'>$_POST[co2_s_sample[$i]]</td> <td align='center'>$_POST[test_type[$i]]</td> [/code] The last two lines will not post.  I tried: [code=php:0] <td align='center'>$_POST[co2_s_sample . [$i] . ]</td> <td align='center'>$_POST[test_type . [$i] . ]</td> [/code] And that did not work.  Any suggestions? Thanks in advance Andy
×
×
  • 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.