GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Script that will bring up different html every time the page is reloaded (https://gfy.com/showthread.php?t=610738)

dial 05-17-2006 07:34 AM

Script that will bring up different html every time the page is reloaded
 
I have a page that I want to code so that every time page.php is loaded it will bring up random html that is predetermined

basically, when someone comes to my site they see ads page for company1, but if they were to hit refresh they would see ads for company2

every time the page is loaded it pulls one of the random html codes I have pre set up in the script

J.P. 05-17-2006 08:18 AM

PHP Code:

<?

$documentList = array(
    'document1.html',
    'document2.html',
    'document3.html'
  );

include $documentList[array_rand($documentList)];

?>


J.P. 05-17-2006 08:19 AM

hmmm... replace the hahahas with square brackets :)

dial 05-17-2006 08:32 AM

Quote:

Originally Posted by J.P.
hmmm... replace the hahahas with square brackets :)

hm....open and close square brackets?

J.P. 05-17-2006 10:54 AM

yepz...

include $documentList[array_rand($documentList)];

hmm... this works outside the php bbcode tags :)

dial 05-17-2006 11:05 AM

that seems to work perfectly

thanks!

~Ray 05-17-2006 03:41 PM

thank you


All times are GMT -7. The time now is 07:39 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123