Help with URL redirection

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Sun Nov 10, 2002 9:16 am

sipmle method.

You can create table with adds links.
Strucrture for exemple:

Code: Select all

| ID | LINK                  |
| 1  | http://www.some1.com/ |
| 2  | http://www.some2.com/ |
| 3  | http://www.some3.com/ |
| 4  | http://www.some4.com/ |
| 5  | http://www.some5.com/ |



//and after that use such SQL query

Code: Select all

$numquery=mysql_query("SELECT * FROM `adds` );
$count=mysql_num_rows($numquery);
$id=rand(0, $count);



Code: Select all

$addquery=mysql_query("SELECT * FROM `adds` WHERE `id` =  '$id' ");

Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests