Jump to content


Photo

Frames W/ PHP


  • Please log in to reply
2 replies to this topic

#1 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 16 October 2006 - 02:44 PM

Hey All,
I'm sure this is really easy, but I must be missing something. I'm trying to make an ad page where it has a frame on the top with the main site logo, and the bottom frame is the actual website that the user is viewing. I want to pass a value through forward.php through to forward_bottom.php

Here is what I have so far:

the link would be forward.php?ad=1

forward.php:
<?php global $ad; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Richmond Critic</title>
</head>

<frameset rows="150,*" frameborder="no" border="0" framespacing="0">
  <frame src="forward_top.php" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
  <frame src="forward_bottom.php?ad=$ad" name="mainFrame" id="mainFrame" title="mainFrame" />
</frameset>
<noframes><body>
</body>
</noframes></html>

forward_bottom.php:
<?php 

	global $ad;

//this will be where it gets the url from the database
	
	echo $ad;

?>

Please let me know if you need any more info.

Thanks,
-Chris

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 16 October 2006 - 02:58 PM

Remove
<?php global $ad; ?>

Change
  <frame src="forward_bottom.php?ad=$ad" name="mainFrame" id="mainFrame" title="mainFrame" />
to
  <frame src="forward_bottom.php?ad=<?php echo $_GET['ad']; ?>" name="mainFrame" id="mainFrame" title="mainFrame" />


#3 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 16 October 2006 - 03:20 PM

Thanks, that helped me get where I wanted to.

-Chris




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users