Jump to content

chriscloyd

Members
  • Posts

    488
  • Joined

  • Last visited

Everything posted by chriscloyd

  1. i was wondering if u guys have any ideas for a web based game im looking to make a web based game but not sure what to make im just asking please let me know
  2. i was wondering if u guys have any ideas for a web based game im looking to make a web based game but not sure what to make im just asking please let me know
  3. this is mysql error i get Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\index.php on line 188 Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\index.php on line 188 Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\index.php on line 188 this is my code [code]<?php 182 //latestpost 183 $re = mysql_query("SELECT * FROM `replies` WHERE cid = '$cid' ORDER BY `rid` DESC LIMIT 0 , 1"); 184 if($re){ 185 $r = mysql_fetch_assoc($re); 186 $ltid = $r['tid']; 187 $ttitle = mysql_query("SELECT * FROM `topics` WHERE tid = '$ltid' ORDER BY `tid` DESC LIMIT 0 , 1 "); 188 $t = mysql_fetch_assoc("$ttitle"); 189 $lon = $r['time']; 190 $lby = $r['by']; 191 $lin = $t['title']; } ?>[/code]
  4. yet this has nothing to do with php help
  5. is there a way to get the lateset row out of two rows? im making a forum and im doing the latest post part and i want it to get the latest one from post or topics tables
  6. i coded one if u want it just pm me and i will give u code but for it to work u ahve to create a mysql db
  7. my login form is not working hmm and it should be i dont see anythign wrong with it can someoen help me it keeps sending me to the ?page=login [code]<?php session_start(); include("db.php"); if(isset($_POST['username'])){ $username = $_POST['username']; $password = $_POST['password']; if ($username == NULL){ $error = 1; $reason = "You did not enter a username"; } else { $error = 0; } if ($password == NULL){ $error = 1; $reason = "You did not enter a username<br>"; } else { $error = 0; $password = md5($password); } if ($error = 0){ $check_info = mysql_query("SELECT * FROM users WHERE username = '$username' "); $info = mysql_fetch_assoc($check_info); if($info > 0){ if($info['password'] == $password){ $_SESSION['sirix'] = $username; } else { $error = 1; $reason = "Your password and the account password did not match!"; } if($info['level'] == "admin"){ $_SESSION['sirixadmin'] = $username; } } header("Location: index.php?page=profile"); } else { header("Location: index.php?page=login&reason=".$reason); } } ?>[/code]
  8. my register script does not work it checks for ip with this [code] <?php //check ip $check_ip = mysql_query("SELECT * FROM users WHERE ip = '$ip'"); //check mysql_query if(!$check_ip){ $error = 0; } else { $reason = "There is already an account registered with that ip address, If you think this is an error please contact webmaster.<br />"; $error = 1; } ?>[/code] but when i register from the same computer witht he same ip it wont set $error to 1
  9. i got it to work i just didnt do '$ip' on the mysql_query
  10. i changed my code to [CODE] <?php //checkbans include("db.php"); $ip = $_SERVER['REMOTE_ADDR']; $cip = mysql_query("SELECT * FROM bans WHERE ip = $ip") or die(mysql_error()); if ($cip) { $reason = $checkip['reason']; header("Location: banned.php?reason=".$reason.""); } ?> [/CODE] and now i get the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.0.1' at line 1
  11. i have done both ip addess my 68.104.210.230 and that one and when i did echo $ip it shows 127.0.0.1
  12. heres my php script for checking for bans [code]<?php //checkbans include("db.php"); $ip = $_SERVER['REMOTE_ADDR']; $cip = mysql_query("SELECT * FROM bans WHERE ip = $ip"); if ($cip) { $reason = $checkip['reason']; header("Location : banned.php?reason=".$reason.""); } ?>[/code] and i have this running off my localhost so i put ip 127.0.0.1 in the database but it wont send me to the banned.php page
  13. I have a form and i enter the info into a mysql database say this is the text i wrote [quote]Hi, how are you today? From Chris[/quote] but when i display it from the mysql db it shows up like [quote]Hi, how are you today?From Chris[/quote] how do i make it show up like [quote]Hi, how are you today? From Chris[/quote]
  14. i get this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/fragradi/public_html/Untitled-1.php on line 14 Topics Replies Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/fragradi/public_html/Untitled-1.php on line 14 Topics Replies but from my code below i dont see an error can someone help me? [code]<?php include("db.php"); $catagories = mysql_query("SELECT * FROM catagories ORDER BY id ASC"); while ($cats = mysql_fetch_array($catagories)) { $id = $cats['id']; $title = $cats['title']; echo '<table width="632" border="0" cellspacing="0" cellpadding="0" class="border">     <tr>     <td class="header2">'.$title.'</td>     <td class="header2">Topics</td>     <td class="header2">Replies</td>   </tr>'; $forums = mysql_query("SELECT * FORM forums WHERE cid = '$id' "); while ($f = mysql_fetch_array($forums)) { $ftitle = $f['name']; $fid =  $f['fid']; $description = $f['description'];   echo '<tr>     <td width="389">'.$ftitle.'<br>'.$description.'</td> <td width="129">'; $nt = mysql_query("SELECT * FROM topics WHERE fid = '$fid' "); $nts = mysql_num_rows($nt); echo $nts; echo '</td>     <td width="114">'; $nr = mysql_query("SELECT * FROM replies WHERE fid = '$fid' "); $nrs = mysql_num_rows($rt); echo $nrs; echo '</td>   </tr> </table><br>'; } } ?>[/code]
  15. okay i get this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/fragradi/public_html/v.1/news.php on line 5 this is my whole code [code]<?php //news get while yaya include("db.php"); $getnews = mysql_query("SELECT * FROM news ORDER by DESC"); while ($news = mysql_fetch_assoc($getnews)) { $tile = $news['topic']; $message = $news['message']; $date = $news['date']; $by = $news['by']; echo '<table width="432" border="0" cellspacing="0" cellpadding="0">   <tr>     <td colspan="2">'.$title.'</td>   </tr>   <tr>     <td colspan="2">'.message.'</td>   </tr>   <tr>     <td width="310">Posted By: '.$by.' on '.$date.'</td>     <td width="122"><div align="right"><a href="comments/'.$nid.'">Comments ('; $count = mysql_query("SELECT * FROM comments WHERE nid = '$nid'"); $numoc = mysql_num_rows($count); echo $numoc; echo ' )</a> </div></td>   </tr> </table>'; } ?>[/code]
  16. heres my xml from shoutcast [code]<SHOUTCASTSERVER> <CURRENTLISTENERS>16</CURRENTLISTENERS> <PEAKLISTENERS>23</PEAKLISTENERS> <MAXLISTENERS>1337</MAXLISTENERS> <REPORTEDLISTENERS>14</REPORTEDLISTENERS> <AVERAGETIME>2262</AVERAGETIME> <SERVERGENRE>Various</SERVERGENRE> <SERVERURL>http://www.audiorealm.com</SERVERURL> <SERVERTITLE>DJ cLegZ</SERVERTITLE> <SONGTITLE>DJ Caffeine - Fuck on Cocaine</SONGTITLE> <SONGURL>http://www.audiorealm.com</SONGURL> <IRC>#audiorealm</IRC> <ICQ>NA</ICQ> <AIM>NA</AIM> <WEBHITS>1108</WEBHITS> <STREAMHITS>316</STREAMHITS> <STREAMSTATUS>1</STREAMSTATUS> <BITRATE>128</BITRATE> <CONTENT>audio/mpeg</CONTENT> <VERSION>1.9.7</VERSION> − <WEBDATA> <INDEX>10</INDEX> <LISTEN>95</LISTEN> <PALM7>717</PALM7> <LOGIN>0</LOGIN> <LOGINFAIL>13</LOGINFAIL> <PLAYED>0</PLAYED> <COOKIE>0</COOKIE> <ADMIN>2</ADMIN> <UPDINFO>99</UPDINFO> <KICKSRC>0</KICKSRC> <KICKDST>0</KICKDST> <UNBANDST>0</UNBANDST> <BANDST>0</BANDST> <VIEWBAN>0</VIEWBAN> <UNRIPDST>0</UNRIPDST> <RIPDST>0</RIPDST> <VIEWRIP>0</VIEWRIP> <VIEWXML>170</VIEWXML> <VIEWLOG>0</VIEWLOG> <INVALID>2</INVALID> </WEBDATA> − <LISTENERS> − <LISTENER> <HOSTNAME>24.250.76.54</HOSTNAME> − <USERAGENT> VLC media player - version 0.8.5 Janus - (c) 1996-2006 the VideoLAN team </USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>9965</CONNECTTIME> <POINTER>1</POINTER> <UID>160</UID> </LISTENER> − <LISTENER> <HOSTNAME>69.123.224.228</HOSTNAME> <USERAGENT>WinampMPEG/5.24</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>4818</CONNECTTIME> <POINTER>2</POINTER> <UID>256</UID> </LISTENER> − <LISTENER> <HOSTNAME>71.29.82.59</HOSTNAME> <USERAGENT>WinampMPEG/5.23</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>3867</CONNECTTIME> <POINTER>7</POINTER> <UID>265</UID> </LISTENER> − <LISTENER> <HOSTNAME>76.184.128.84</HOSTNAME> <USERAGENT>NSPlayer/10.0.0.3650 WMFSDK/10.0</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>3270</CONNECTTIME> <POINTER>5</POINTER> <UID>282</UID> </LISTENER> − <LISTENER> <HOSTNAME>69.142.152.167</HOSTNAME> <USERAGENT>WinampMPEG/5.31</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>3137</CONNECTTIME> <POINTER>4</POINTER> <UID>291</UID> </LISTENER> − <LISTENER> <HOSTNAME>65.27.242.219</HOSTNAME> <USERAGENT>WinampMPEG/5.23</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>3071</CONNECTTIME> <POINTER>9</POINTER> <UID>293</UID> </LISTENER> − <LISTENER> <HOSTNAME>129.93.212.32</HOSTNAME> <USERAGENT>iTunes/6.0.4 (Windows; N)</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>2851</CONNECTTIME> <POINTER>10</POINTER> <UID>295</UID> </LISTENER> − <LISTENER> <HOSTNAME>64.217.217.129</HOSTNAME> <USERAGENT>WinampMPEG/5.31</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>2010</CONNECTTIME> <POINTER>3</POINTER> <UID>297</UID> </LISTENER> − <LISTENER> <HOSTNAME>68.104.214.101</HOSTNAME> <USERAGENT>WinampMPEG/5.31</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>1755</CONNECTTIME> <POINTER>8</POINTER> <UID>298</UID> </LISTENER> − <LISTENER> <HOSTNAME>68.104.187.250</HOSTNAME> <USERAGENT>WinampMPEG/5.24</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>1182</CONNECTTIME> <POINTER>13</POINTER> <UID>303</UID> </LISTENER> − <LISTENER> <HOSTNAME>69.142.152.167</HOSTNAME> <USERAGENT>WinampMPEG/5.24</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>1105</CONNECTTIME> <POINTER>0</POINTER> <UID>304</UID> </LISTENER> − <LISTENER> <HOSTNAME>70.80.81.42</HOSTNAME> <USERAGENT>NSPlayer/10.0.0.3802 WMFSDK/10.0</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>1083</CONNECTTIME> <POINTER>15</POINTER> <UID>306</UID> </LISTENER> − <LISTENER> <HOSTNAME>69.148.71.71</HOSTNAME> <USERAGENT>WinampMPEG/5.24</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>874</CONNECTTIME> <POINTER>14</POINTER> <UID>309</UID> </LISTENER> − <LISTENER> <HOSTNAME>69.148.71.71</HOSTNAME> <USERAGENT>WinampMPEG/5.09</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>814</CONNECTTIME> <POINTER>16</POINTER> <UID>310</UID> </LISTENER> − <LISTENER> <HOSTNAME>71.60.193.244</HOSTNAME> <USERAGENT>WinampMPEG/5.31</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>691</CONNECTTIME> <POINTER>12</POINTER> <UID>312</UID> </LISTENER> − <LISTENER> <HOSTNAME>68.6.122.230</HOSTNAME> <USERAGENT>WinampMPEG/5.21</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>687</CONNECTTIME> <POINTER>17</POINTER> <UID>313</UID> </LISTENER> </LISTENERS> − <SONGHISTORY> − <SONG> <PLAYEDAT>1162531885</PLAYEDAT> <TITLE>DJ Caffeine - Fuck on Cocaine</TITLE> </SONG> − <SONG> <PLAYEDAT>1162531716</PLAYEDAT> <TITLE>Weird Al - White And Nerdy</TITLE> </SONG> − <SONG> <PLAYEDAT>1162531443</PLAYEDAT> <TITLE>Basshunter - Boten Anna</TITLE> </SONG> − <SONG> <PLAYEDAT>1162531203</PLAYEDAT> <TITLE>Switchfoot - Dare You to Move</TITLE> </SONG> − <SONG> <PLAYEDAT>1162531133</PLAYEDAT> <TITLE>Gaither Gospel Series - Jesus Loves Me This I Know</TITLE> </SONG> − <SONG> <PLAYEDAT>1162530872</PLAYEDAT> <TITLE>Haddaway - What is Love?</TITLE> </SONG> − <SONG> <PLAYEDAT>1162530673</PLAYEDAT> <TITLE>Buckcherry - Crazy Bitch</TITLE> </SONG> − <SONG> <PLAYEDAT>1162530477</PLAYEDAT> <TITLE>Switchfoot - Meant to Live</TITLE> </SONG> − <SONG> <PLAYEDAT>1162530272</PLAYEDAT> <TITLE>Britney Spears - Oops I Did It Again</TITLE> </SONG> − <SONG> <PLAYEDAT>1162530108</PLAYEDAT> <TITLE>R. Kelly - (I Wanna) Pee On You</TITLE> </SONG> </SONGHISTORY> </SHOUTCASTSERVER> [/code] i wanna get the station name out of it how would i do that with php?
  17. ya thats only when u post it from forms its already assigned like [CODE] <?php $id //but when its a get its assigned like $_GET['id'] ?> [/CODE]
  18. chriscloyd

    XML

    i have an XML page and i wanna get the information off it and show it on my other page how do i go along doing that?
  19. well did u save them into a database when they choose if they want to or not?
  20. u could make it a button then at the bottom of the script right before the ?> put this in header("Location: pagehere"); that will make it send an invoice to all users but u can just make it and include on ur main admin page so eveyrtime u go on the admin page it will send but it will not send by its self unless u use cron job
  21. [code]<?php if(date('F') == "Janurary"){ $month = "February"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "February"){ $month = "March"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "March"){ $month = "April"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "April"){ $month = "May"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "May"){ $month = "June"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "June"){ $month = "July"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "July"){ $month = "August"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "Auguse"){ $month = "September"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "September"){ $month = "October"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "October"){ $month = "November"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "November"){ $month = "December"; $day = date('j'); $duedate = $month.', '.$day; } if(date('F') == "December"){ $month = "Janurary"; $day = date('j'); $duedate = $month.', '.$day; } $dueinvoice = mysql_query("SELECT * FROM tablename WHERE duedate = '$duedate'"); // then do the mail function for each row found while($userinvoice = mysql_num_rows($dueinvoice)){ //$message = Type Your Message Here //$headers = Your HEaders Here //$subject = Subject Here mail($userinvoice['email'],$subject,$message,$headers); } ?>[/code]
  22. i hvae a script where people can come to my site sign up and either create a team or join a team when an admin hits the button generate schedule i wanna be able to match each team up to 8 other teams and save all the information into my db can someoen help me get started
  23. thanks for that session i cant tell if it works yet because it wont let me run the login script its weird i ahve done millions of login scripts and this is the only problem one i have ever made :(
  24. i changed my code but i still get those three errors [quote] Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/chris/public_html/login.php on line 17 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/chris/public_html/login.php on line 22 Warning: Cannot modify header information - headers already sent by (output started at /home/chris/public_html/login.php:17) in /home/chris/public_html/login.php on line 36[/quote] heres my new code [code]<?php session_start(); include("db.php"); $HadErrors = false; if(!$email){   $_SESSION['Errors'] = 'Missing email address.';   $HadErrors = true; } if(!$password){   $_SESSION['Errors'] = 'Missing password.';   $HadErrors = true; } if($HadErrors){   header( 'Location: index.php' ); } $check_admin = mysql_query("SELECT * FROM admins WHERE email = '$email'"); $admin = mysql_num_rows($check_admin); if($admin['email'] == $email){ $_SESSION['cssadmin'] = $email; } $check_user = mysql_query("SELECT * FROM users WHERE email = '$email'"); $user = mysql_num_rows($check_user); if($user == '1'){ $password = md5($password); if($user['password'] == $password){ $_SESSION['css'] = $email; } else { $_SESSION['Errors'] = 'Password was incorrect.';   $HadErrors = true; } } else { $_SESSION['Errors'] = 'Email address was not found in database.'; $HadErrors = true; } if($HadErrors == true){ header( 'Location: index.php' ); } ?>[/code]
×
×
  • 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.