Jump to content

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">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Richmond Critic</title>

<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" />


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.

Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

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.