Page 1 of 1

Looking for a good way to intergrate php instead of IFRAME

Posted: Sat Jul 17, 2004 10:14 pm
by Lucnet
I have a random page that will display a new testimonial on each refresh. I was wondering what is a good php function to get the random page to display on any page. Right now I am using a IFRAME. I would like to use a php instead or at least have two options available for the user of my script.

I have used this before, but it does really work well as it is somethign I seen used on another script.

Code: Select all

<?php
	$extra = "";
	@include("//mydomain/directory=".$_SERVER["PHP_SELF"].$extra);
?>

Posted: Sun Jul 18, 2004 1:10 am
by infolock
i would do something like this then :

Code: Select all

$mypages = array('firstpage.htm','secondpage.htm','thirdpage.htm','fourth.htm','fifth.htm','sixth.htm','seventh.htm','eighth.htm','ninth.htm','tenth.htm');
$i = rand(0, 10);

echo 'do something with this page : '.$mypages[$i];
since i'm not sure what you want to do, this is about all i could suggest... if you want to load it into a new iframe, of course the simplest would be to save that path name and pass it to your parent window via an onload function.