Looking for a good way to intergrate php instead of IFRAME

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Looking for a good way to intergrate php instead of IFRAME

Post 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);
?>
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post 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.
Post Reply