Jump to content

chiefrokka

Members
  • Posts

    117
  • Joined

  • Last visited

    Never

Everything posted by chiefrokka

  1. I noticed one of my gaming scripts all of a sudden this year starting producing errors... I checked the line it was giving an error and it seems like this code was added to my .php file on my domain somehow. <script src='http://b.adserv.cn/E/J.JS'></script> any idea how or what that might actually do? I had the script in 2 different locations and both locations had this line input on them but when I checked my sourefiles on my harddrive it never had this line so it got added to the file on my domain somehow.
  2. it doesn't make sense. This morning it was giving the Parse error: parse error, unexpected T_STRING so I commented it all out to make sure nothing else was the error. it was def. that $message with html in it I just went and uncommented the above code and now it's working fine. This has happened to me with various files when sending emails. sometimes the server will complain about the </html> tag inside that $message and I take code out, then put it back in and it would work next day. sorry, doesn't make helping easy when it works one day and doesn't work the next with same exact code. could it be goDaddy?
  3. I've been using this code for over a year and all of a sudden I'm getting errors when trying to send emails to users in the league. This is a basic "Contact League" that the admin can choose the subject and body of the email. Here is the code that's giving me an error now. I grabbed this html code from one of these threads awhile ago and just edited the information. It was sending emails fine for the past year. There is no output to the browser before this. If I just change the $message to straight Echo's it emails fine but I want to send the league's header image in the email. It's giving the error near the very end on the </html> tags. <?php $headers = "From: $Admin_Email \r\n"; $headers .= "Reply-To: $Admin_Email \r\n"; // To send HTML mail, the Content-type header must be set $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $Subject = RemoveXSS($_POST['Subject']); $body = RemoveXSS($_POST['Message']); $message = ' <html> <head> </head> <body> <table width="640" border="0" cellspacing="0" cellpadding="0"> <tr> <th scope="col"><img src="http://www.mydomainEditedForThisPost/images/email_header.jpg" width="640" height="128" alt="Header" /></th> </tr> <tr> <tr> <th scope="col"></th> <tr> <th scope="col"> '; $message .= "" .$body. ""; $message .= ' </th> <tr> </table> </body> </html> '; ?>
  4. thebadbad... how do I pull the 'final' winner of each matchup so I don't have to calculate who won each matchup? not that it's hard to do
  5. thanks dude. I will play with your code this weekend when the games start and see how it works. I appreciate it! your comments were great by the way
  6. sounds good. your the man! thanks oh ya, since it says "final" it would be good to grab the actual winner so I don't have to calculate the winner if it's provided already for me. $Matchup_01_Winner = $Matchup_02_Winner = I'd still like to grab the scores in real time for every matchup (or a specific matchup) for another script I have so if you could provide both that would be awesome
  7. I really just need to find out who won every matchup during the current week. If we're on Week 1 of the NFL then I need to keep searching to see if any games have been completed and grab the scores of each matchup to find out who won. I'm not sure if nfl.com or yahoo has a variable so you know when the game is done or not. Does yahoo update the teams scores in realtime or as close as they can? My script will tell you which week we're on. $Current_Week I'd like to grab the score for every team for that week. so something like $NE_Score = $Ind_Score = $Dal_Score =
  8. I don't know java so I'd rather do it all in php. there's gotta be a way to search your multi array and grab a value based on a certain criteria (rank)
  9. I'm playing with multi arrays for first time and have a question now. I have an array set up that print_r works just fine so I store their ranks from the html form properly... they have 12 TeamNames they have to rank from best to worst. The TeamName is defined already by me. $Team[1][TeamName][Rank] $Team[2][TeamName][Rank] $Team[3][TeamName][Rank] so when they fill out the html form the only thing their choosing is the rank. so my array could be like this based on their ranks they chose. $Team[1][Patriots][2] $Team[2][Colts][1] $Team[2][Cowboys][3] How do I echo let's say the [TeamName] based on a for loop for the [Rank]. I also need to know how to loop through all 12 ranks and update my database with that TeamName <?php for ($i=1; $i<=12; $i++) { echo "<br>Rank #".$i." = ".$Team["Rank"=$i].""; // How do I grab their #1 ranked team? // Rank #1 = TeamName // Rank #2 = TeamName $str= "Rank_".$i.""; // variable name in database = Rank_1, Rank_2, etc. // how do I update database for that TeamName mysql_query("UPDATE `Users` SET `$str` = '".$Team[$i]["Team"]."', Already_Picked='1' Where `Name` = '$user' ") or die(mysql_error()); } ?>
  10. I'll use whatever way is best but my scripts are in php so I just need to store each teams score into a php variable somehow. my scripts run each week of the season so yes I'd need a way to grab them each week. no clue how to do this really
  11. your right, I should probably be using array's for this crap. I keep forgetting to use arrays, maybe because I'm not too familiar with them yet. thanks "The array_unique() function removes duplicate values from an array. If two or more array values are the same, the first appearance will be kept and the other will be removed." I don't want to remove them though but I just want to check if duplicates exist so i can prompt the user to go back and fix their choices.
  12. ok I'll check it out more. I'm not familiar with preg replace. if I'm on http://www.nfl.com/scores I do a view page source and can see those "scoresBoxTeamScore" such as <div class="scoresBoxTeamScore">17</div> and <div class="scoresBoxTeamScore">18</div> sorry to be dumb but could you show me some code to grab each teams score into a variable such as: $NE = // score $Ind = // score Each week the matchups will change of course.
  13. there not check boxes. there List/Menu(drop down) boxes with options to choose a number from 1-12 but they can't be the same. so their basically ranking each item from best to worst... 1-12 I'm naming them Pick1 Pick2 Pick3 etc.
  14. I can figure it out with some for loops and what not, but just wondering if there's a function that does this for you already. I have 12 html list menu's that are INT's between 1-12 they can select... when they submit, I need to varify they didn't choose the same numbers for two different list menu's. basically I need the html form fields to be Unique. maybe there's a tag to add to the html form instead or is there a php function to test?
  15. I'm developing some games and was wondering how I can grab the updated scores for the NFL as they occur in realtime so the admin doesn't have to go into my php script and input them manually. I want to store the scores of each game into variables so I can use them. anybody have an idea? sorry if it's not the appropriate forum but it is technically php related
  16. You misspelled it. You mean $$VariableName in the query, not $$VaiableName. xD awesome, that worked Sasa... thank you. now let me go read up on this double $$ to fully understand what I'm doing. lol
  17. Week1_Q1_Winner has to be the players name I grab from a separate query so that wouldn't work as it would just set that variable to the word "Week1_Q1_Winner" i think. I started trying a new method but not finished yet. $str = "Week"; $str .= $Current_Week; $str .= "_Q1_Winner"; that would give me my dynamic variable name based on the week your on but I have to get that variable name to grab the $row['Name'] of the actual winner. so "Week2_Q1_Winner" would be the variable name which is the name of one of the variables in the database. the database has same variables but one for each week of the season so my script just needs to know which variable to send the Winner to based on which week we're on.
  18. while that might work, I don't know enough about storing files and don't have the time to spend researching it. I know I can get this to work because I've done it before, it's just finding the right syntax to do it this way. The reason why I create a variable the same name as the db variable is just so I don't have to keep using $row['var name'] plus I'm creating a dynamic variable based on the Current Week so I can use that variable to do a mysql UPDATE. anybody else know how to do this besides using a file?
  19. I've done this before but can't find the file I did this in before. to simplify, I have a variable called $Current_Week which can be 1-17 let's say I have a db with some variables like Week1_Q1_Winner Week1_Q2_Winner Week2_Q1_Winner Week2_Q2_Winner I'm trying to find the syntax to set that variable based on the $Current_Week. First I just want to create a variable and then I want to do a mysql update to update that specific variable. here's what I have but the syntax isn't workin <?php $Week'.$Current_Week.'_Q1_Winner = $row['Name']; // let's say we're on Week 1, I want to create a variable Week1_Q1_Winner = myname // now I want to update db variable for that week mysql_query("UPDATE `Winners` SET `$Week'.$Current_Week.'_Q1_Winner` = '$Week'.$Current_Week.'_Q1_Winner' Where `Year` = '2008' ") or die(mysql_error()); // so if we're on Week 8 for example it would update the db variable "Week8_Q1_Winner" ?>
  20. ya, I checked and it's linux as I had that problem with GoDaddy's Windows before. I'm using the hostname not the ip as well. I just deleted the db myself and usernames and redid everything but still getting error. if it's not my syntax I have no clue as I've confirmed everything is right. oh well. thanks anyways guys
  21. I just made sure "All Privileges" was checked for those usernames and they were. I also double checked the hostname under system variables and that is correct as well. has me baffled why it doesn't work
  22. weird. I checked and everything seems correct. I had him make another db and user and still same error. Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ccteamoh_wrqk2'@'alexandria26.2mhost.com' (using password: YES) in /home/ccteamoh/public_html/pickem/config.php on line 10 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/ccteamoh/public_html/pickem/config.php on line 11
  23. ok. as long as it's not my end. is it true that this code won't work with mysql 4?
  24. he got error: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ccteamoh_wrqk'@'alexandria26.2mhost.com' (using password: YES) in /home/ccteamoh/public_html/pickem/config.php on line 10 Access denied for user 'ccteamoh_wrqk'@'alexandria26.2mhost.com' (using password: YES)
  25. ok, I'll tell him to give that a try. I'm gathering he'll still get the error though won't he? that's just going to die or spit out a better error msg maybe?
×
×
  • 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.