Jump to content

Archived

This topic is now archived and is closed to further replies.

cmgmyr

Frames W/ PHP

Recommended Posts

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: [code]<?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>[/code]

forward_bottom.php:[code]<?php

global $ad;

//this will be where it gets the url from the database

echo $ad;

?>[/code]

Please let me know if you need any more info.

Thanks,
-Chris

Share this post


Link to post
Share on other sites
Remove [code]<?php global $ad; ?>[/code]

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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.