USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 4/21/06 08:53 PM
Sign-Up: 09/26/02
Posts: 198
hello fellow geeks. i am having a problem with doing random content. by this i mean you know them pages where its random.php or image.php?id=0 and when you go to them it takes you to image.php?id=42 or whatever the randomly selected database row is.
i think they have one in the portal http://www.newground..om/portal/random.php
see what i mean.
how do i do this?
Posted at: 4/21/06 11:49 PM
Sign-Up: 09/13/03
Posts: 12,282
Do something similar to this.
# Make sure you have already established # your MySQL connection and that you have # already selected your database.
$getRand = mysql_query("SELECT id FROM portalEntries ORDER BY RAND() LIMIT 1"); # Get ID $randEntry = @mysql_result($getRand, 0, 'id');
header('Location: entry.php?id=' . $randEntry);
holy jesus what are these goddamn animals
All times are Eastern Standard Time (GMT -5) | Current Time: 01:36 PM
<< Back