Welcome Guest ( Log In | Register )



 
Reply to this topicStart new 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: 887
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



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: 750
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



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 topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Question About Professional 3d Animating(21)
  2. Force Object To Load Last(2)
  3. Question: Vector Based Animation?(4)
  4. Mp3 Questions(14)
  5. Question About Asp Now() Function(6)
  6. Photoshop Tutorial: Adding Color To Black And White Photo(5)
  7. How To Install Applications In Fedora(12)
  8. Add A Forum To Your Site(23)
  9. MySQL Output Database Question(18)
  10. Web Browser And Taskbar Problems (web Browser Disappears)(7)
  11. VB.NET / MS Access Question(6)
  12. Help: Adding My Videos Folder To Start Menu(10)
  13. What's The Best CMS(35)
  14. Ipod Hardware And Software Question(9)
  15. Gaia Online Question(6)
  1. Do Google Search Better Than Yahoo?(15)
  2. 4 Ram Slots Question(6)
  3. Private Servers Question(13)
  4. Dynamic Php Image And Better Php Code Question(10)
  5. Joomla License Question(1)
  6. Simple Java Question(3)
  7. Site Link Analyzer Tool(1)
  8. Php Question, Help Please(5)
  9. Can You Link Game Maker With Mysql/php(0)
  10. Link To Other Computers(4)
  11. Question About Opengl Codes.(0)
  12. Hacked By Dumansal(2)
  13. Css Minus The <p>(9)


 



- Lo-Fi Version Time is now: 7th September 2008 - 11:09 PM