is there any code for random url? also want to check Browser url and set some condition is that possible? like if $url = something then print this one waiting for reply from php guys Thanks.
For the second part, use $_SERVER variables. Simply, print_r($_SERVER) to see what element you need to handle. For the first part, what do you mean by random URL? If you want the user to visit random URLs, put them in an array and get a random value from it.
For the first part this is the answer, <? //random URLs $urls = array("http://link1.com" ,"http://link2.com" ,"http://link3.com" ); //text links for each URL $text = array("LINK 1" ,"LINK 2" ,"LINK 3"); srand(time()); //set the number in (rand()%3); for as many links you have added $random = (rand()%3); echo ("<a target=\"_blank\" href = \"$urls[$random]\">$text[$random]</a>"); ?> Code (markup):
answer is yes, you can use a database to call random urls that is entered by you or someone else. this is just about adding urls to database. second part of question is : of course yes may be you should better find a link exchange scripts. you can find that code there. take it easy kirpikinzi