Web Hosting Talk







View Full Version : display random links


aht
05-21-2005, 10:40 PM
I want to know of a script that I can use that will display random links that uses MYSQL and PHP.

For example...I would be able to add the links to a mysql database and have the appear randomly on a php page. By random I mean everytime I refresh the page it would have different links.

If anyone knows of a script like that please let me know...it will need to be one I can customize. Since I have a few other things I am going to add to it.

whoiscartpro
08-15-2005, 04:44 PM
You can find some scripts at urls below:

http://www.ljscripts.com/freescripts/
http://www.devscripts.net/browse/39.php

bizbla
08-25-2005, 12:55 AM
You can find one here too...
http://www.hotscripts.com/index.html

lemonadeX
09-05-2005, 09:20 AM
The code is relatively simple for that. The MySQL query would be:

SELECT link FROM yourtable ORDER BY rand() LIMIT 1;

Make sure to change 'link' to the column name and 'yourtable' to the table containing the links. All you have to do then is output the result whichever way you want.

lemonadeX