Welcome Guest ( Log In | Register )




                Web Hosting

 
Reply to this topicNew Topic
Php Question Re Adding A Link, inside a top frame
ginginca
post Aug 27 2006, 11:59 AM
Post #1


Premium Member
Group Icon

Group: Members
Posts: 250
Joined: 6-July 06
From: The net (or at least that's what my family says)
Member No.: 14,330


I have a directory site that someone else programmed for me a couple of years ago. I have been making my own modifications to the script, and generally not running into many issues, since the changes are usually pretty basic.

When a visitor clicks on a category, it takes them to a category page which lists all the sub categories, and under each category is a list of the links in it.

When you click on one of the links, it takes you to a frame page. I have a tiny frame across the top which allows them to stay within the site.

(Q) I would like to add a tiny link in my top frame that says "remove this frame" and it would dynamically link to their site, hence removing the frame.

CODE
<HTML>
<HEAD>

  <TITLE><?echo $link_info[1];?> - London Ontario Canada Southwestern Ontario Business Directory</TITLE>
</HEAD>
<FRAMESET frameborder="0" ROWS="8%,92%">
  <FRAME SCROLLING="No" NORESIZE SRC="header.php?cat=<? echo $cat;?>">
  <FRAME SRC="<? echo $page; ?>">
</FRAMESET>

<NOFRAMES>
<BODY>
<P>
</BODY></NOFRAMES></HTML>


Here's an example of the page: http://www.londonlink.ca/link.php?cat=24&a...blesideinn.com/

I hope I have given you enough information to answer my question. Thanks in advance.

Gin

This post has been edited by ginginca: Aug 27 2006, 12:00 PM
Go to the top of the page
 
+Quote Post
vujsa
post Aug 27 2006, 05:01 PM
Post #2


Absolute Newbie
Group Icon

Group: Admin
Posts: 888
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714
myCENTs:35.43


Well, you'll need to go ahead and pass that URL to header.php as well as the link.php

It is difficult to say for sure what you need to do without being able to see all of your code. But here is what I image needs to be done:
First in the code you pasted, you'll need to modify one of your urls. Find this:
CODE
  <FRAME SCROLLING="No" NORESIZE SRC="header.php?cat=<? echo $cat;?>">


and change to:
CODE
  <FRAME SCROLLING="No" NORESIZE SRC="header.php?cat=<? echo $cat;?>&page=<? echo $page; ?>">


Then in your header.php file, somewhere after the link back to the directory, you'll need to add the link data.

Here is what I'm not sure of since I don't have your code to basically match the style of programming used.

This is the most direct way to do it but you can modify it as you need!
In your header.php file add this after your link back to the index but keep it far enough up to not be hidden.
CODE
<a href="<?php echo $_GET['page']; ?>  target='_top'>Break Frames</a>"


In your header.php code, you may have a line that reads something like this:
CODE
$cat = $_GET['cat'];


If that is the case, you can do the same with $page if you like.
Just below the line for $cat, add this:
CODE
$page = $_GET['page'];


Then your link code would ALSO change to this:
CODE
<a href="<?php echo $page; ?>  target='_top'>Break Frames</a>"


I only bring this up because it is most likely the method that was originally used when the script was written.

If this doesn't work, you'll need to post the source code for link.php and header.php so it can be correctly evaluated. Since most of the code you actually posted is HTML, it makes it difficult to answer your PHP question confidently.

Hope This Helps. cool.gif

vujsa
Go to the top of the page
 
+Quote Post
TavoxPeru
post Aug 27 2006, 11:38 PM
Post #3


Super Member
Group Icon

Group: [HOSTED]
Posts: 818
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579
myCENTs:3.57


The solution that vujsa offers is very simple and powerful, another way to do it i think is by using the location object of javascript, something like this:
CODE

<a href="#" onclick="top.location.href='<?php echo $_GET['page']; ?>'">Remove this Frame</a>

Best regards,
Go to the top of the page
 
+Quote Post

Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts   6 Orca239 860 31st December 2008 - 09:29 AM
Last post by: mastercomputers
No New Posts   4 CiaraMarie 2,182 23rd December 2008 - 08:24 PM
Last post by: iG-Lucky
No New Posts   4 FirefoxRocks 225 4th December 2008 - 03:57 AM
Last post by: FirefoxRocks
No New Posts   7 mzwebfreak 3,710 24th November 2008 - 10:52 PM
Last post by: iG-Rachael
No New Posts   3 tpog 258 12th November 2008 - 04:35 PM
Last post by: khalilov
No New Posts   5 veerumits 263 4th November 2008 - 10:03 PM
Last post by: minimcmonkey
No New Posts   1 JeffGirard 1,098 23rd September 2008 - 07:16 PM
Last post by: adavak
No New Posts   9 sandeep 1,801 3rd September 2008 - 11:10 AM
Last post by: Guest
No New Posts   3 sparkx 357 25th August 2008 - 06:02 AM
Last post by: magiccode9
No New Posts   18 lonebyrd 2,788 18th August 2008 - 09:41 PM
Last post by: Guest
No New Posts   4 FirefoxRocks 554 10th August 2008 - 09:54 PM
Last post by: FirefoxRocks
No New Posts   0 Feelay 183 9th August 2008 - 11:37 AM
Last post by: Feelay
No New Posts   9 WeaponX 1,167 30th July 2008 - 07:44 AM
Last post by: Guest
No new   21 lacking_imagination 4,349 30th July 2008 - 04:57 AM
Last post by: Guest
No New Posts   6 dhanesh 1,537 25th July 2008 - 01:20 PM
Last post by: Guest