Jump to content

Masna

Staff Alumni
  • Posts

    288
  • Joined

  • Last visited

Everything posted by Masna

  1. Much, much, much better! But it still needs some graphics. Come up with some personal logo that would fit.
  2. Try this instead: if (isset($_POST['submit']) && ($_POST['submit'] == "Stop")) { for ($i=0; $i < 2; $i++) { if (isset($_SESSION['answer'.$i])) { //do nothing } else { $_SESSION['answer'.$i] = "wrong"; } } redirect_to($_SESSION['currentpage'] . "?quizid=" . $_SESSION['quizid']); } else { // do nothing }
  3. Yes, it will. But don't forget to quote the actual hex colors. Although, you've created an infinite loop there...
  4. Try each one (or all) of these following three ini-sets: $your_site = "site.com"; //change this to your domain ini_set("SMTP","mail.".$your_site.".com"); ini_set("smtp_port","25"); ini_set("sendmail_from", "info@".$your_site.".com");
  5. $get_rows = mysql_query("SELECT * FROM `list_of_things`"); $i = 0; while($row = mysql_fetch_assoc($get_rows)){ if($i % 2 == 0){ $bg_color = 'light-grey'; } else { $bg_color = 'grey'; } //echo information you want displayed $i++; }
  6. Where is this query being executed? In what file are you trying to execute it? It should be in previews.php. Is that where it is?
  7. Try... $query = $db->execute("select p.id, p.username, p.level, p.money, p.last_active, p.banned, p.staff, p.rm, p.ncolor, p.ncolorid, p.city_id, l.id, l.username, l.prize_money, l.time from `players` p, `lottery` l where p.id=l.id"); while($member = $query->fetchrow())
  8. Have you confirmed that the query is actually a valid query? Also, in what file is the query executed?
  9. $file_string = '<div style="padding-bottom:5px;"><a target="_parent" title="'.$row['post_subject'].'" href="' . $url . '">' . $subject . '</a> - ' . $row['username'] . ' : ' . date("D m/d/y, h:ia",$row['post_time']) . ' </div>'; file_put_contents("collective_file.txt", $file_string, FILE_APPEND);
  10. Try changing this... WHERE P.team_id='{$id}' ...to this: WHERE P.team_id='".$_GET['id']."'
  11. Ok first you have to buy it. Then you put it on (don't forget the switch!) and call the one you need. And after that you use what you know to apply it correctly and it works. And you're done! It's simple!
  12. $count_q = mysql_query("SELECT COUNT(lottery) FROM `members` WHERE `lottery`='1'"); $count_assoc = mysql_fetch_assoc($count_q); $amount_of_members_with_lottery_equal_equal_1 = $count_assoc['COUNT(lottery)'];
  13. I did some Google-ing, and found this... http://www.usenet-forums.com/php-general/48969-re-php-retrieving-enum-description-mysql.html Hope it helps!
  14. Lol, well of course not. It's a result resource link. You have to use mysql_fetch_assoc() to get a usable array from the SELECT query. $number_of_winners = 1; $get_winners = mysql_query("SELECT * FROM `members` WHERE `lottery`='1' ORDER BY RAND() LIMIT ".$number_of_winners); $winner = mysql_fetch_assoc($get_winners); //$winner now stores an array of data for one particular (randomly chosen) member //Assuming that members have a username... echo $winner['username'];
  15. Masna

    Ip Logs.

    I suggest creating an IP Logs table (maybe called 'ip_logs'). Create it with three fields: user_id, ip_address, timestamp (stores a UNIX timestamp). Then, upon each successful login, insert a new row into the table including the user's ID, IP address, and time stamp, respectively. To grab a user's IP... $ip_address = $_SERVER['REMOTE_ADDR'];
  16. unset($rows[1]); unset($rows[count($rows)-1]);
  17. Actually, no, you don't.
  18. I've found that when presented in a situation like this, it's always best to ask yourself... What's not wrong with diagonal lines?
  19. Well, why are you trying to encode everything with UTF-8? Is that the correct encoding for Czech?
  20. I'm going to assume you know how to add a field called "lottery" and how to set it to '1' when a user chooses to enter the lottery. For selecting random lottery winners... $number_of_winners = 10; //change this to fit your needs $winners = array(); for($i = 0; $i < $number_of_winners; $i++){ $get_winner = mysql_query("SELECT * FROM `members` WHERE `lottery`='1' ORDER BY RAND() LIMIT 1"); $winners[] = mysql_fetch_assoc($get_winner); } //$winners now contains a multi-dimensional array of 10 winners Be sure to note that you may not actually have to query 10 winners separately, but possibly 10 winners in one query. I'm not sure exactly how ORDER BY RAND() works (whether it picks a random spot and then returns ordered rows from there or if it picks 10 rows independently and all at random). It probably randomizes each row selection. So, this may work... $number_of_winners = 10; $get_winners = mysql_query("SELECT * FROM `members` WHERE `lottery`='1' ORDER BY RAND() LIMIT ".$number_of_winners); //use $get_winners at your discretion But, again, I'm not sure and I'm too tired to test on my own.
  21. Store itself in itself... Sounds like you're trying to cause the universe to implode.
  22. I'm not sure how to do it with DATETIME format, but you can do it very easily if you store a UNIX timestamp instead: $timestamp = {retrieve timestamp from MySQL database here}; $timestamp += (60*60*17);
  23. You would use $referrer = $_GET['ref']; What lies in the $_GET quotes is the name of the variable in the URL. Yes, you can still get it.
×
×
  • 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.