Jump to content

random URL Generator


xyn

Recommended Posts

You could use a simple script like this...

[code]
<?php
mysql_connect ('localhost', 'username', 'password') ;
mysql_select_db ('database_name');
$number = 3 ;
$result = mysql_query ("SELECT * FROM images ORDER BY RAND() LIMIT $number");
while ($row = mysql_fetch_array($result))
{
echo "<a href=\"" . $row["link"] . "\">
<img src=\"" . $row["image"] . "\" border=0 alt=\"" . $row["text"] . "\">
</a>" ;
}
?>
[/code]

Link to comment
https://forums.phpfreaks.com/topic/16049-random-url-generator/#findComment-66110
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.