Masna
-
Posts
288 -
Joined
-
Last visited
Posts posted by Masna
-
-
What about switching to something like this?
http://www.trenttompkins.com/concept.jpg
Just a real standard Web 2.0 look - 4 sections with the nav part of each section and a nice homepage? I'm a programmer, not a designer -- maybe this is all I need?
Much, much, much better!
But it still needs some graphics. Come up with some personal logo that would fit.
-
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 }
-
Yes, it will. But don't forget to quote the actual hex colors.
Although, you've created an infinite loop there...
-
-
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");
-
$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++; }
-
Neither suggestion has worked, but I'm not sure what I'm doing either!
I tested the query in phpmyadmin just to be sure it works, and it was a success. It's obviously got to be something with my WHERE clause.
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?
-
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())
-
Have you confirmed that the query is actually a valid query? Also, in what file is the query executed?
-
$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);
-
Try changing this...
WHERE P.team_id='{$id}'
...to this:
WHERE P.team_id='".$_GET['id']."'
-
ok. Iv got this problem. that is extremely idiotic and irritating. But could someone please tell me how to make a board. like as in on the site. or is it a category. i dont remeber what to do.
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!
-
$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)'];
-
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!
-
I tried to echo get winners and it didnt echo anything... hmm
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'];
-
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'];
-
unset($rows[1]); unset($rows[count($rows)-1]);
-
I don't know? I like them...
Actually, no, you don't.
-
...What's wrong with the diagonal lines by the way?
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?
-
Well, why are you trying to encode everything with UTF-8? Is that the correct encoding for Czech?
-
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.
-
Store itself in itself... Sounds like you're trying to cause the universe to implode.
-
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);
-
Hi All,
Thank much for the quick replies, I really appreciate it.
Does the "$referrer = $_GET['referrer'];" statement get any referral id or does it just get the ones that are identified by a particular code. For instance if my referral code is "http://amazinghomeventures.com?ref=ahvceo", would the above statement work or would I use "$referrer = $_GET['ref'];"?
You would use $referrer = $_GET['ref']; What lies in the $_GET quotes is the name of the variable in the URL.
Does the statement return "referrer=username or just the username?Does it work if there is an interveining URL? For instance if someone is referred to my site and I send them to PayPal before I try to get the referrers name, can I still get it this way?
Thanks again, looking forward to your next reply!
ahvceo
Yes, you can still get it.
[SOLVED] Syntax in for loop?
in PHP Coding Help
Posted
No problem!