Jump to content

timmah1

Members
  • Posts

    1,170
  • Joined

  • Last visited

Everything posted by timmah1

  1. Why does this show "cannot get results!" constantly?? $events = array(); $query = "SELECT title, DATE_FORMAT(event_date'%Y-%c-%e') AS event_date FROM events WHERE event_date LIKE '$year-$month%'"; $result = mysql_query($query,$db) or die('cannot get results!'); while($row = mysql_fetch_assoc()) { $events[$row['event_date']][] = $row; } Thanks in advance
  2. I'm assuming that this is there because of the join page. I found this on there if($submit3) { if(!ereg("^[A-Za-z0-9_]{1,16}$",$susername)) { $serror="Invalid username! Use no more than 15 characters and only letters, numbers, and underscores.<br>"; } $this->c=@mysql_query("select username from users25 where username='$susername'"); $this->d=mysql_fetch_object($this->c); if(is_object($this->d)) { $serror="Username is already in use<br>"; } $this->c=@mysql_query("select username from pending25 where username='$susername'"); $this->d=mysql_fetch_object($this->c); if(is_object($this->d)) { $serror="Username is already in use<br>"; } if (!$serror) { mt_srand((double)microtime()*1000000^getmypid()); $pass_length = mt_rand($this->min_pass_length,$this->max_pass_length); while(strlen($spassword)<$pass_length) { $spassword.=substr($this->chars,(mt_rand()%strlen($this->chars)),1); } include("include/emails.php"); $signupmessage=str_replace("<username>","$susername",$signupmessage); $signupmessage=str_replace("<password>","$spassword",$signupmessage); $signupmessage=str_replace("<first_name>","$sfirst_name",$signupmessage); $signupmessage=str_replace("<last_name>","$slast_name",$signupmessage); $signupmessage=str_replace("<login_url>","$login_url",$signupmessage); $subject = "$signupsubject"; $message = "$signupmessage"; mail($semail,$subject,$message,"From: $admin25email"); $admin25signupmessage = str_replace("<username>","$susername",$admin25signupmessage); $admin25signupmessage = str_replace("<password>","$spassword",$admin25signupmessage); $admin25signupmessage = str_replace("<first_name>","$sfirst_name",$admin25signupmessage); $admin25signupmessage = str_replace("<last_name>","$slast_name",$admin25signupmessage); $admin25signupmessage = str_replace("<member_email>","$semail",$admin25signupmessage); $subject = "$admin25signupsubject"; $message = "$admin25signupmessage"; mail($admin25email,$subject,$message,"From: $admin25email"); $nowdate = date("M d, Y"); mysql_query("insert into users25 (uid, username, password, first_name, last_name, street, city, state, zip, country, email, telephone, last_paid, signup_date) values ('','$susername', '$spassword', '$sfirst_name', '$slast_name', '$sstreet', '$scity', '$sstate', '$szip', '$scountry', '$semail', '$stelephone', 'free', '$nowdate')"); echo "<h3>Signup for a New Account Complete</h3>$table2 <tr><td align=center>Thank you for signing up $susername. We have sent you a welcome email to <b>$semail</b> with your password.</table>"; }
  3. I guess that's the problem, because I'm not sure Here is the header file <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Language" content="en-us"> <title><?=$sitename?></title> <meta http-equiv='Content-Type' content='text/html; charset=windows-1252'/> <link href='style.css' type='text/css' rel='stylesheet'/> </head> <body bgcolor="F2F2F2"> <p><b><a href="index.php">Home</a></b> | <b><a href="rules.php">Rules</a></b> | <b><a href="faq.php">F.A.Q.</a></b> | <b><a href="join.php">Join</a></b> | <b> <a href="account.php">Account</a></b> | <b><a href="contactus.php">Contact Us</a></b></p> Here is the index file <? include("include/common.php"); include("include/header.php"); ?> <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <p> </p> </p> </td> </tr> <tr> <td> <div align=center> <form ENCTYPE="multipart/form-data" method="post" name="form1" action="upload.php"> <INPUT NAME="attached" TYPE="file" size="50"><br> File extensions allowed: <b><?=implode("</b>, <b>",explode("|",$att_filetypes))?></b><br> File size limit: <b><?=$att_max_size?>KB</b> <br><br> <input type="submit" name="submit" value="Upload File"> </form> </div> </td> </tr> </table> <? include("include/footer.php"); ?> And the common file where the error is happening <?php session_start(); include("config.php"); $att_path = "./uploads"; $paypal_item = $sitename." Service Monthly Subscription"; $paypal_item_number = $sitename; $mainipn = $siteurl."/ipn.php"; $paypal_ipn = $siteurl."/site_ipn.php"; $paypal_cancel_return = $siteurl."/cancel.php"; $paypal_return = $siteurl."/thanks.php"; $this->min_pass_length=8; $this->max_pass_length=12; $this->chars='abcdefghijklmnopqrstuvwxyz0123456789'; $logfile = "logfile.txt"; $postmode = 1; $invalidcode = "<table bgcolor=#ffffff cellpadding=4 width=170><tr><td align=center><font size=2><b>Invalid Button Code!</b><p>Run Your Own PayPal Donation Campaigns at <a href=$siteurl/join.php>$sitename</a></font></table>"; $table1 = "<TABLE class=design bgColor=#ffffff cellPadding=3 cellSpacing=0 width=100% border='1' BORDERCOLOR='#C0C0C0' STYLE='border-collapse: collapse'>"; $table2 = "<TABLE class=design bgColor=#ffffff cellPadding=3 cellSpacing=0 width=100% border='1' BORDERCOLOR='#C0C0C0' STYLE='border-collapse: collapse'>"; $table3 = "<TABLE class=design bgColor=#ffffff cellPadding=3 cellSpacing=0 width=100% border='1' BORDERCOLOR='#C0C0C0' STYLE='border-collapse: collapse'>"; @mysql_connect($dbServer, $dbUser, $dbPass) or die("Couldn't connect to database server: " . mysql_error()); @mysql_select_db($dbName) or die("Couldn't connect to database: " . mysql_error()); function errform($msg, $var = ''){ global $posterr, $_POST; $posterr = 1; echo "<div style='color: #FF0000;'>$msg</div>"; if ($var) $_POST[$var] = ''; } function addreport($user,$site,$status){ mysql_query("INSERT INTO report SET user='$user',site='$site',status='$status',date='".time()."'"); } function quickcheck($host,$port){ $running = @fsockopen($host, $port, $errno, $errstr, 30); if (!$running){ return 0; }else { fclose($running); return 1; } } function fullstatus($host){ $services = array( "http"=>"80", "ssh"=>"22", "ftp"=>"21", "smtp"=>"25", "pop3"=>"110", "mysql"=>"3306"); $date = date("l, M d, Y - h:i:s A"); ?> <p><font face="Arial" size="2"><b>System Status: <?= $host ?></b></font><br>Time: <?= $date ?></p> <font face="Arial" size="2"> <p><table> <tr bgcolor="#5590CC"><td>Status</td><td>Service</td><td>Host</td></tr> <? foreach ($services as $name=>$port){ $running = @fsockopen($host, $port, $errno, $errstr, 30); if (!$running){ $status_color = "red"; $status_sign = "X"; }else { fclose($running); $status_color = "green"; $status_sign = " "; } echo "<tr><td align=center><div align=\"center\" style=\"font-size: 20pt; border: 2px solid $status_color; color:$status_color;\" width=\"15\" height=\"15\">$status_sign</div></td><td>$name</td><td>$host</td></tr>"; } ?> </table></p> <? } function writecombo($array_name, $name, $selected = "", $start = 0, $add_text = "", $add_text2 = "") { $length = count ($array_name); if (($array_name == "") || ($length == 0)){ echo "<select name=\"$name\"></select>\n"; }else{ echo "<select name=\"$name\" $add_text $add_text2>\n"; while (list($key, $val) = @each($array_name)) { if( !is_array($val) ){ $select_name = $val; $i = $key; echo " <option value=\"$i\""; if ($i == $selected){ echo " selected"; } echo ">$select_name</option>\n"; } } echo "</select>\n"; } } function myround($amt,$dec="3"){ ob_start(); if($dec == 2){ printf("%6.2f",$amt); }else{ printf("%6.3f",$amt); } $amount = ob_get_contents(); ob_end_clean(); $amount = str_replace(" ","",$amount); return $amount; } class fptime{ function fptime(){ return 1; } function mytime($stamp="",$format="m/d/Y"){ return date( $format,($stamp ? $stamp : time()) ); } function stamp($mm,$dd,$yy,$hh=0,$min=0,$sec=0){ return mktime($hh,$min,$sec,$mm,$dd,$yy); } function subhours($interval,$mm,$dd,$yy,$hh,$m,$s){ return $this->stamp( $mm,$dd,$yy,($hh-$interval),$m,$s ); } function addhours($interval,$mm,$dd,$yy,$hh,$m,$s){ return $this->stamp( $mm,$dd,$yy,($hh+$interval),$m,$s ); } function subdays($interval,$mm,$dd,$yy){ return $this->stamp($mm,($dd-$interval),$yy); } function adddays($interval,$mm,$dd,$yy,$hh=0,$min=0,$sec=0){ return $this->stamp($mm,($dd+$interval),$yy,$hh,$min,$sec); } function submonths($interval,$mm,$dd,$yy){ return $this->stamp( ($mm-$interval),$dd,$yy ); } function addmonths($interval,$mm,$dd,$yy){ return $this->stamp( ($mm+$interval),$dd,$yy ); } function subyears($interval,$mm,$dd,$yy){ return $this->stamp( $mm,$dd,($yy-$interval) ); } function addyears($interval,$mm,$dd,$yy){ return $this->stamp( $mm,$dd,($yy+$interval) ); } function DateDiff ($interval, $date1,$date2) { // get the number of seconds between the two dates $timedifference = $date2 - $date1; switch ($interval) { case "w": $retval = $timedifference/604800; $retval = floor($retval); break; case "d": $retval = $timedifference/86400; $retval = floor($retval); break; case "h": $retval = $timedifference/3600; $retval = floor($retval); break; case "n": $retval = $timedifference/60; $retval = floor($retval); break; case "s": $retval = floor($timedifference); break; } return $retval; } function dateNow($format="%Y%m%d"){ return(strftime($format,time())); } function dateToday(){ $ndate = time(); return( $ndate ); } function daysInMonth($month="",$year=""){ if(empty($year)) { $year = $this->dateNow("%Y"); } if(empty($month)) { $month = $this->dateNow("%m"); } if($month == 2) { if($this->isLeapYear($year)) { return 29; } else { return 28; } } elseif($month == 4 or $month == 6 or $month == 9 or $month == 11) { return 30; } else { return 31; } } function isLeapYear($year=""){ if(empty($year)) { $year = $this->dateNow("%Y"); } if(strlen($year) != 4) { return false; } if(preg_match("/\D/",$year)) { return false; } return (($year % 4 == 0 && $year % 100 != 0) || $year % 400 == 0); } } $month_values= array( "0"=>"--", "1"=>"Jan", "2"=>"Feb", "3"=>"Mar", "4"=>"Apr", "5"=>"May", "6"=>"Jun", "7"=>"Jul", "8"=>"Aug", "9"=>"Sep", "10"=>"Oct", "11"=>"Nov", "12"=>"Dec", ); $day_values= array( "0"=>"--", "1"=>"1", "2"=>"2", "3"=>"3", "4"=>"4", "5"=>"5", "6"=>"6", "7"=>"7", "8"=>"8", "9"=>"9", "10"=>"10", "11"=>"11", "12"=>"12", "13"=>"13", "14"=>"14", "15"=>"15", "16"=>"16", "17"=>"17", "18"=>"18", "19"=>"19", "20"=>"20", "21"=>"21", "22"=>"22", "23"=>"23", "24"=>"24", "25"=>"25", "26"=>"26", "27"=>"27", "28"=>"28", "29"=>"29", "30"=>"30", "31"=>"31", ); ?> I'm not sure where that is declared
  4. I'm trying to help a friend, and I have no idea why I'm getting this error. Fatal error: Using $this when not in object context in /home/include/common.php on line 11 This is the code <?php session_start(); include("config.php"); $att_path = "./uploads"; $paypal_item = $sitename." Service Monthly Subscription"; $paypal_item_number = $sitename; $mainipn = $siteurl."/ipn.php"; $paypal_ipn = $siteurl."/site_ipn.php"; $paypal_cancel_return = $siteurl."/cancel.php"; $paypal_return = $siteurl."/thanks.php"; $this->min_pass_length=8; $this->max_pass_length=12; $this->chars='abcdefghijklmnopqrstuvwxyz0123456789'; $logfile = "logfile.txt"; $postmode = 1; ?> Can anyone help me out here? Thanks in advance
  5. I got it. Stupid thing really I did this $message .= "blah blah"; Instead of this $message = "blah blah"; Now it sends it the way I need it to thanks for you help sasa
  6. ok, it's outside the foreach loop, now I'm back to square 1. Sends 1 email, with only the last pick in the body <?php if(isset($_POST['submit'])){ include("connect.php"); if (!empty($_POST['description'])) { foreach($_POST['description'] as $row=>$Act) { $description = mysql_real_escape_string($Act); $game = $_POST['posted_y'][$row]."-".$_POST['posted_m'][$row]."-".$_POST['posted_d'][$row]; $game_time = mysql_real_escape_string($_POST['game_time'][$row]); $game_time1 = mysql_real_escape_string($_POST['game_time1'][$row]); $away_team = mysql_real_escape_string($_POST['away'][$row]); $home_team = mysql_real_escape_string($_POST['home'][$row]); $premiere = mysql_real_escape_string($_POST['premiere'][$row]); $prediction = mysql_real_escape_string($_POST['prediction'][$row]); $week = mysql_real_escape_string($_POST['week'][$row]); $posted_date = $_POST['posted_year']."-".$_POST['posted_month']."-".$_POST['posted_day']; $sport = mysql_real_escape_string($_POST['sport']); if (!empty($description)) { $sql = "INSERT INTO picks(sport, posted, game, game_time, game_time1, description, away, home, prediction, premiere, week) VALUES( '$sport', '$posted_date', '$game', '$game_time', '$game_time1', '$description', '$away_team', '$home_team', '$prediction', '$premiere', '$week');"; mysql_query($sql) or die("Sorry, there was a problem adding picks<br /> ".mysql_error()); $sql1 = "SELECT * FROM $sport WHERE id = '$home_team'"; $q1= mysql_query($sql1); while($a1= mysql_fetch_assoc($q1)){ $home_team1 = $a1['team']; } $sql2 = "SELECT * FROM $sport WHERE id = '$away_team'"; $q2= mysql_query($sql2); while($a2= mysql_fetch_assoc($q2)){ $away_team1 = $a2['team']; } $to = "Vegas D Sports <tpatterson@cheezyfries.net>"; //$to = "Vegas D Sports <notify@vegasdsports.com>"; $today = date("F j, Y", strtotime($posted_date)); $today1 = $posted_date; $subject = "10FreeFootballPicks.com Pick Updates For ".$today.""; $message = " <html> <style type='text/css'> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } .main { border: thin solid #000; } .header { color: #fff; font-weight: bold; } --> </style> <body> <table width='600' border='0' align='center' cellpadding='6' cellspacing='0' class='main'> <tr> <td align='center' valign='top' bgcolor='#333333' class='header'><h2>10 FREE FOOTBALL PICKS UPDATE</h2></td> </tr> <tr> <td valign='top' align='left'><table width='100%' border='0' cellspacing='0' cellpadding='6'> <tr> <td colspan='4' bgcolor='#d6d5d5'>The following 'picks' information has been uploaded.</td> </tr> <tr> <td bgcolor='#d6d5d5'> <table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td><strong>Date: </strong>$today</td> </tr> <tr> <td>Game: $game </tr> <tr> <td>$away_team1 vs $home_team1</td> </tr> <tr> <td>$game_time</td> </tr> <tr> <td>$description<br />$prediction</td> </tr> </table> </td> </tr> <tr> <td colspan='4' bgcolor='#d6d5d5'> </td> </tr> </table></td> </tr> </table> </body> </html> "; $name = "10FreeFootballPicks.com"; $from = "website@10FreeFootballPicks.com"; $headers = "From: ". $name . " <" . $from . ">\r\n"; $headers .= "Content-Type: text/html; charset=\"iso-8859-1\""; $headers .= "Content-Transfer-Encoding: 7bit"; //$headers .= 'Cc: dgriffin@cpcsllc.com' . "\r\n"; //$headers .= 'Bcc: tpatterson@cheezyfries.net' . "\r\n"; // now lets send the email. } } mail($to, $subject, $message, $headers); } echo "Picks for '".date("F j, Y", strtotime($posted_date))."' has been uploaded<br />"; echo "<a href='$back'>Go back to picks page</a>"; } ?>
  7. This is what I did, and now, it sends 10 different emails, all with different picks. I'd like this to send 1 email, with all the picks in the 1 emails <?php if(isset($_POST['submit'])){ include("connect.php"); if (!empty($_POST['description'])) { foreach($_POST['description'] as $row=>$Act) { $description = mysql_real_escape_string($Act); $game = $_POST['posted_y'][$row]."-".$_POST['posted_m'][$row]."-".$_POST['posted_d'][$row]; $game_time = mysql_real_escape_string($_POST['game_time'][$row]); $game_time1 = mysql_real_escape_string($_POST['game_time1'][$row]); $away_team = mysql_real_escape_string($_POST['away'][$row]); $home_team = mysql_real_escape_string($_POST['home'][$row]); $premiere = mysql_real_escape_string($_POST['premiere'][$row]); $prediction = mysql_real_escape_string($_POST['prediction'][$row]); $week = mysql_real_escape_string($_POST['week'][$row]); $posted_date = $_POST['posted_year']."-".$_POST['posted_month']."-".$_POST['posted_day']; $sport = mysql_real_escape_string($_POST['sport']); if (!empty($description)) { $sql = "INSERT INTO picks(sport, posted, game, game_time, game_time1, description, away, home, prediction, premiere, week) VALUES( '$sport', '$posted_date', '$game', '$game_time', '$game_time1', '$description', '$away_team', '$home_team', '$prediction', '$premiere', '$week');"; mysql_query($sql) or die("Sorry, there was a problem adding picks<br /> ".mysql_error()); $sql1 = "SELECT * FROM $sport WHERE id = '$home_team'"; $q1= mysql_query($sql1); while($a1= mysql_fetch_assoc($q1)){ $home_team1 = $a1['team']; } $sql2 = "SELECT * FROM $sport WHERE id = '$away_team'"; $q2= mysql_query($sql2); while($a2= mysql_fetch_assoc($q2)){ $away_team1 = $a2['team']; } //$to = "Vegas D Sports <tpatterson@cheezyfries.net>"; $to = "Vegas D Sports <notify@vegasdsports.com>"; $today = date("F j, Y", strtotime($posted_date)); $today1 = $posted_date; $subject = "10FreeFootballPicks.com Pick Updates For ".$today.""; $message = " <html> <style type='text/css'> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } .main { border: thin solid #000; } .header { color: #fff; font-weight: bold; } --> </style> <body> <table width='600' border='0' align='center' cellpadding='6' cellspacing='0' class='main'> <tr> <td align='center' valign='top' bgcolor='#333333' class='header'><h2>10 FREE FOOTBALL PICKS UPDATE</h2></td> </tr> <tr> <td valign='top' align='left'><table width='100%' border='0' cellspacing='0' cellpadding='6'> <tr> <td colspan='4' bgcolor='#d6d5d5'>The following 'picks' information has been uploaded.</td> </tr> <tr> <td bgcolor='#d6d5d5'> <table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td><strong>Date: </strong>$today</td> </tr> <tr> <td>Game: $game </tr> <tr> <td>$away_team1 vs $home_team1</td> </tr> <tr> <td>$game_time</td> </tr> <tr> <td>$description<br />$prediction</td> </tr> </table> </td> </tr> <tr> <td colspan='4' bgcolor='#d6d5d5'> </td> </tr> </table></td> </tr> </table> </body> </html> "; $name = "10FreeFootballPicks.com"; $from = "website@10FreeFootballPicks.com"; $headers = "From: ". $name . " <" . $from . ">\r\n"; $headers .= "Content-Type: text/html; charset=\"iso-8859-1\""; $headers .= "Content-Transfer-Encoding: 7bit"; $headers .= 'Cc: dgriffin@cpcsllc.com' . "\r\n"; //$headers .= 'Bcc: tpatterson@cheezyfries.net' . "\r\n"; // now lets send the email. mail($to, $subject, $message, $headers); } } } echo "Picks for '".date("F j, Y", strtotime($posted_date))."' has been uploaded<br />"; echo "<a href='$back'>Go back to picks page</a>"; } ?>
  8. I have a script that adds things to the database, then is suppose to send an email, with everything in the message, to one person. I can get the script to send, but it only shows one item, and it's suppose to show every one of the picks. Here is my script. <?php if(isset($_POST['submit'])){ include("connect.php"); if (!empty($_POST['description'])) { foreach($_POST['description'] as $row=>$Act) { $description = mysql_real_escape_string($Act); $game = $_POST['posted_y'][$row]."-".$_POST['posted_m'][$row]."-".$_POST['posted_d'][$row]; $game_time = mysql_real_escape_string($_POST['game_time'][$row]); $game_time1 = mysql_real_escape_string($_POST['game_time1'][$row]); $away_team = mysql_real_escape_string($_POST['away'][$row]); $home_team = mysql_real_escape_string($_POST['home'][$row]); $premiere = mysql_real_escape_string($_POST['premiere'][$row]); $prediction = mysql_real_escape_string($_POST['prediction'][$row]); $week = mysql_real_escape_string($_POST['week'][$row]); $posted_date = $_POST['posted_year']."-".$_POST['posted_month']."-".$_POST['posted_day']; $sport = mysql_real_escape_string($_POST['sport']); if (!empty($description)) { $sql = "INSERT INTO picks(sport, posted, game, game_time, game_time1, description, away, home, prediction, premiere, week) VALUES( '$sport', '$posted_date', '$game', '$game_time', '$game_time1', '$description', '$away_team', '$home_team', '$prediction', '$premiere', '$week');"; mysql_query($sql) or die("Sorry, there was a problem adding picks<br /> ".mysql_error()); $sql1 = "SELECT * FROM $sport WHERE id = '$home_team'"; $q1= mysql_query($sql1); while($a1= mysql_fetch_assoc($q1)){ $home_team1 = $a1['team']; } $sql2 = "SELECT * FROM $sport WHERE id = '$away_team'"; $q2= mysql_query($sql2); while($a2= mysql_fetch_assoc($q2)){ $away_team1 = $a2['team']; } } } $message = " <html> <style type='text/css'> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } .main { border: thin solid #000; } .header { color: #fff; font-weight: bold; } --> </style> <body> <table width='600' border='0' align='center' cellpadding='6' cellspacing='0' class='main'> <tr> <td align='center' valign='top' bgcolor='#333333' class='header'><h2>10 FREE FOOTBALL PICKS UPDATE</h2></td> </tr> <tr> <td valign='top' align='left'><table width='100%' border='0' cellspacing='0' cellpadding='6'> <tr> <td colspan='4' bgcolor='#d6d5d5'>The following 'picks' information has been uploaded.</td> </tr> <tr> <td bgcolor='#d6d5d5'> <table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td><strong>Date: </strong>$today</td> </tr> <tr> <td>Game: $game </tr> <tr> <td>$away_team1 vs $home_team1</td> </tr> <tr> <td>$game_time</td> </tr> <tr> <td>$description<br />$prediction</td> </tr> </table> </td> </tr> <tr> <td colspan='4' bgcolor='#d6d5d5'> </td> </tr> </table></td> </tr> </table> </body> </html>"; $to = "Vegas D Sports <tpatterson@cheezyfries.net>"; //$to = "Vegas D Sports <notify@vegasdsports.com>"; $today = date("F j, Y", strtotime($posted_date)); $today1 = $posted_date; $subject = "10FreeFootballPicks.com Pick Updates For ".$today.""; $name = "10FreeFootballPicks.com"; $from = "website@10FreeFootballPicks.com"; $headers = "From: ". $name . " <" . $from . ">\r\n"; $headers .= "Content-Type: text/html; charset=\"iso-8859-1\""; $headers .= "Content-Transfer-Encoding: 7bit"; //$headers .= 'Cc: dgriffin@cpcsllc.com' . "\r\n"; //$headers .= 'Bcc: tpatterson@cheezyfries.net' . "\r\n"; // now lets send the email. } mail($to, $subject, $message, $headers); echo "Picks for '".date("F j, Y", strtotime($posted_date))."' has been uploaded<br />"; echo "<a href='$back'>Go back to picks page</a>"; } ?> Can anybody see why it I have more than 2 messages, it only send the last one? Thanks in advance
  9. Why does my text show weird characters? Here is how it looks on the page We’re starting this night off but it should look like We're starting this night off When this is inserted, I'm using TinyMCE for an editor, and I guess it inserts that automatically I am doing this for that text area $special = mysql_real_escape_string($_POST['special']); What else can I do so that is not inserted into the database?
  10. Stuie, That works fine, thank you. But how to I keep it from displaying a - after the last result? Meaning, right now it shows like this September 12, 2009 - September 13, 2009 - Is there a way with that code to eliminate the last -?
  11. I need to be able to show each date separated by a dash This shows all the dates it is supposed to, but it puts them all together, with no space or anything. How can I put a dash between the dates if there are more than 1, and not show the dash if there is only one? Here is my code <?php include("../connect.php"); $query5 = "SELECT * FROM picks WHERE week = '$current_week' GROUP BY game"; $w5 = mysql_query($query5) or die(mysql_error()); while ($b5 = mysql_fetch_array($w5)) { $week = $b5['week']; $current_game .= date("F j, Y", strtotime($b5['game'])); } echo "<h2 align='center'>FREE FOOTBALLL PICKS FOR WEEK $week - $current_game</h2>"; ?> Right now, it shows it like this FREE FOOTBALLL PICKS FOR WEEK 1 - September 12, 2009September 13, 2009 I'd like to be able to show it like this FREE FOOTBALLL PICKS FOR WEEK 1 - September 12, 2009 - September 13, 2009 Thanks in advance
  12. oh man. Something simple that is overlooked!! Thank you RekoNiZe
  13. I have this form that a user submits and it shows them everything that is in the database for that particular week I would like all the results to show in a textarea, so that they can copy and paste it. But, this only puts one of the results, the last one, in the text box. can anybody tell me what I'm doing wrong or show me how I can get all the results to show in the textarea? <?php $query = "SELECT * FROM picks WHERE week = '$week' AND YEAR(posted) = '".date("Y")."'"; $picks = mysql_query($query); $numrows = mysql_num_rows($picks); if($numrows == 0){ echo "No picks for $week1!<br /><a href='export_picks.php'>Go Back!</a>"; } else { while($a = mysql_fetch_array($picks)){ $sport = $a['sport']; $game = date("F j, Y", strtotime($a['game'])); $game_time = $a['game_time']; $description = nl2br($a['description']); $away = $a['away']; $home = $a['home']; $prediction = $a['prediction']; $sql = "SELECT * FROM $sport WHERE id = '$home'"; $q= mysql_query($sql); while($a= mysql_fetch_assoc($q)){ $home_team = $a['team']; $home_image = "<img src='http://www.10freefootballpicks.com/sports/$a[image]' alt='$a[team]' width='100' />"; } $sql = "SELECT * FROM $sport WHERE id = '$away'"; $q= mysql_query($sql); while($a= mysql_fetch_assoc($q)){ $away_team = $a['team']; $away_image = "<img src='http://www.10freefootballpicks.com/sports/$a[image]' alt='$a[team]' width='100' />"; } $string = " <table width='100%' border='0' align='center' cellpadding='2' cellspacing='0' class='side'> <tr> <td align='center' colspan='3'><h1><em>$away_team at $home_team</em></h1> <h2><em>Game Time: $game, $game_time</em></h2></td> </tr> <tr> <td align='right'>$away_image</td> <td align='center' valign='middle'><h1> vs </h1></td> <td align='left'>$home_image</td> </tr> <tr> <td colspan='3' align='left' valign='top'>$description</td> </tr> <tr> <td colspan='3' align='center' valign='top'><font color='#ff0000'><strong>$prediction</strong></font></td> </tr> </table>"; echo $string; } echo "<br /><textarea name='' cols='75' rows='5'>$string</textarea><br /><br />"; } } ?> Thanks in advance
  14. venturemc, Here is the code that I got working <?php $xml=("http://www.novafantasysports.com/xml/bbfpbasketballplayernews/node_feed/?User=bbfreepicks_nbaplayernews&pw=bbfpFFBP"); $xmlDoc = new DOMDocument(); $xmlDoc->load($xml); $x=$xmlDoc->getElementsByTagName('article'); $sql = "INSERT INTO nba_feeds(title, author, content, date_posted, uploaded) VALUES"; for ($i=0; $i<=19; $i++) { $item_title=$x->item($i)->getElementsByTagName('title') ->item(0)->childNodes->item(0)->nodeValue; $item_author=$x->item($i)->getElementsByTagName('author') ->item(0)->childNodes->item(0)->nodeValue; $item_created=$x->item($i)->getElementsByTagName('created') ->item(0)->childNodes->item(0)->nodeValue; $item_desc=$x->item($i)->getElementsByTagName('content') ->item(0)->childNodes->item(0)->nodeValue; $sql .= "('" . mysql_real_escape_string($item_title). "', '". mysql_real_escape_string($item_author) . "', '". mysql_real_escape_string($item_desc) . "', '". mysql_real_escape_string($item_created) . "', '" . date("Y-m-d H:i:s") . "')"; if($i < 19) { $sql .= ", "; } else { $sql .=";"; } } $result = mysql_query($sql); ?>
  15. I'm trying to show news like this, separating by date 8-20-2009 TITLE 8-19-2009 TITLE TITLE TITLE TITLE 8-18-2009 TITLE TITLE So far, this only shows the top date. <?php $query = "SELECT date_posted FROM nfl_feeds_history "; $w = mysql_query($query) or die(mysql_error()); while($b = mysql_fetch_array($w)){ $posted = $b['date_posted']; $archived = mysql_query("SELECT * FROM nfl_feeds_history WHERE date_posted = '$posted'"); } echo date("F j, Y", strtotime($posted)); while($t = mysql_fetch_array($archived)){ $title = $t['title']; $id = $t['id']; echo "<h2><a href='history_news.php?id=$id'>$title</a></h2>"; } ?> Can anybody help me out here? Thanks in advance
  16. I eliminated the radio button for a select menu. Works better now Thanks for your help
  17. no. That don't show as checked either
  18. Why does this not show this as being checked? <?php $sport = "nfl"; $team02 = "69"; $favorite = "69&sports=nfl"; $str = $favorite; $parts = explode('&', $str); $fav = $parts[0]; require("config.php"); $sql="SELECT * FROM $sport WHERE id = '$fav' AND size = 'lg'"; $result = mysql_query($sql); $numrows = mysql_num_rows($result); if($numrows == 0){ echo "<div id='txtHint'>"; echo "NO-Favorite:<br /><input type=\"radio\" name=\favorite\" value=\"$team02&sports=$sport\" />"; echo "<p><img src=\"images/$sport/$row1[image]\" alt=\"$row1[team]\" width=\"150\" /></p>"; echo "<h2>$row1[team]</h2></div>"; } else { while($row1 = mysql_fetch_array($result)){ //if($fav == $row1['id']){ //echo " echo "<div id='txtHint'>"; echo "YES-Favorite:<br /><input type=\"radio\" name=\"favorite\" value=\"$fav&sports=$sport\" checked=\"checked\" />"; echo "<p><img src=\"images/$sport/$row1[image]\" alt=\"$row1[team]\" width=\"150\" /></p>"; echo "<h2>$row1[team]</h2></div>"; } } ?> It echoes out the YES, but it won't show the radio button as being checked. How can something so simple create so much havoc! Thanks in advance
  19. I have a form that pulls feeds from a site, and inserts them into the database <?php $xml=("http://www.novafantasysports.com/xml/bbfpbasketballplayernews/node_feed/?User=bbfreepicks_nbaplayernews&pw=bbfpFFBP"); $xmlDoc = new DOMDocument(); $xmlDoc->load($xml); //get and output "<item>" elements $x=$xmlDoc->getElementsByTagName('article'); $sql = "INSERT INTO feeds_history(title, author, content, date_posted) VALUES"; for ($i=0; $i<=19; $i++) { $item_title=$x->item($i)->getElementsByTagName('title') ->item(0)->childNodes->item(0)->nodeValue; $item_author=$x->item($i)->getElementsByTagName('author') ->item(0)->childNodes->item(0)->nodeValue; $item_created=$x->item($i)->getElementsByTagName('created') ->item(0)->childNodes->item(0)->nodeValue; $item_desc=$x->item($i)->getElementsByTagName('content') ->item(0)->childNodes->item(0)->nodeValue; $sql .= "('" . mysql_real_escape_string($item_title). "', '". mysql_real_escape_string($item_author) . "', '". strip_tags(mysql_real_escape_string($item_desc)) . "', '". mysql_real_escape_string($item_created) . "')"; //echo ("<a href='" . $item_link . "'>" . $item_title . "</a>"); //echo ($item_desc); if($i < 19) { $sql .= ", "; } else { $sql .=";"; } } $result = mysql_query($sql); ?> Now I need to check it there are any duplicates, and then delete only the duplicates, except one from the database. So, if there are 3 of the title "Try This", I need to delete 2 of those rows. How would I go about doing this?
  20. Thank you both for all your help. I finally got it work with this <?php // Checks posted reciprocal link // function GetDomain($reciprocal){ $nowww = ereg_replace('www.','',$reciprocal); $domain = parse_url($nowww); if(!empty($domain["host"])){ return $domain["host"]; }else{ return $domain["path"]; } } // Checks reciprocal link database // function Domain($main_url) { $nowww = ereg_replace('www.','',$main_url); $domain = parse_url($nowww); if(!empty($domain["host"])){ return $domain["host"]; } else { return $domain["path"]; } } $sql1="SELECT r_url FROM exchange_links"; $result1=mysql_query($sql1) or die("Could not get link information."); while($g1=mysql_fetch_array($result1)) { $main_url = $g1['r_url']; } if(GetDomain($reciprocal) == Domain($main_url)){ echo "This domain name is already listed<br />"; echo "You may only submit 1 link per domain<br />"; echo "You may <a href='http://www.basketballfreepicks.com/contact_us/'>contact us</a> about listing another reciprocal link"; } ?> The problem with your benphelps, was it ran the posted link through the function to strip everything but the domain, but not the link in the database, so it would still submit it. With yours kratsg, if somebody posted http://www.test.com, and then came back and posted http://test.com, it allowed it to post. But with both of your help, I was able to get this to work. Thanks again
  21. Much cleaner than mine benphelps, but I get the same results The script does that check, and if it passes, then it checks if the reciprocal link is listed on the page they say, if not, it gives an error Right now, in the database has a reciprocal link as http://www.vegasdsports.com/main/ When I try and add another link like http://www.vegasdsports.com/main/links.php, it gives the error that the link cannot be found, so it passed through the check if the url's are the same
  22. Dong a basic search on Google for basic php login script returns NUMEROUS tutorials http://www.google.com/search?q=basic+php+login+script&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
  23. Could be your missing a $ on line10 <php $display_block .= "<table cellpadding=3 cellspacing=3 border=1> <tr> <th>KNIGHTS</th>"; if ($num_knights<10){ $num_knights = "0".$num_knights; } $display_block .= " <th># OF PLAYERS: $num_knights</th> </tr>"; ?> this works for me <?php $num_knights = 9; $display_block .= "<table cellpadding=3 cellspacing=3 border=1> <tr> <th>KNIGHTS</th>"; if ($num_knights<10){ $num_knights = "0".$num_knights; } $display_block .= " <th># OF PLAYERS: $num_knights</th> </tr></table>"; echo $display_block; ?>
×
×
  • 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.