Php Question Re Adding A Link - inside a top frame

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Php Question Re Adding A Link - inside a top frame

ginginca
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

 

 

 


Reply

vujsa
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

 

 

 


Reply

TavoxPeru
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,

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Similar Topics

Keywords : php, question, adding, link, inside, top, frame

  1. Making A Link = Mysql_query
    (8)
  2. Adding Security Enhancements To Php Programs
    Security enhancements of PHP programs (0)
    PHP is becoming the language for even general programming more as it has seen from PHP4 to PHP5. PHP
    originally started as CGI script language connected with the internet. Thus, PHP is closely related
    with the internet and security - whether the problem comes from security leak point of internet
    protocols or not - problems related to the internet. There are two major security issues when your
    PHP program(s) has something to do with the internet. There can be memory leak and security leak
    from the program of PHP not connected - or connected - to the internet by PHP settin....
  3. Vujsa's CMS101 And CMS102 Tutorials
    Where is the link between cms101 & cms102 tutorials (4)
    I have read Vujsa's tutorials on cms101 and cms102. As a beginner to cms, php and mysql this
    tutorial has been very helpful. Thanx for Vujsa, really appreciate what you've done for guys
    like. But I have had a problem with the missing links. How do I integrate this tutorial with tables
    I create in php/mysql database. I understand the includes, the problem is with the files I would
    have create in mysql table. How do I link to those files using includes and is there a management
    page for the files I create using mysql. Thank you as I await your reply.....
  4. Php :: Adding Image Over Image
    (5)
    Hi Masters & Champions. I want some help regarding putting and image over some location (x pixel ,
    y pixel) of an image. Here it is quite important to note that the mage which is Inserted over an
    image must be clickable. Like for example suppose i put T on an image DD then the T must be
    clickable. Please gudie as this is quite important for me . Thanks ....
  5. Friend Networking Script... Help!
    Adding & removing friends (1)
    I'm creating my own friend network script which is going to be a combo of MySpace/Facebook and
    an AIM profile. One of the most important features is the adding of friends. The way to do this is
    probably simple & I'll kick myself when I see the code to do it. What needs to happen is a
    friend clicks a link which sends an internal message through the scripts messaging system (like a PM
    on a forum) to the other person to approve or deny the request. In that message, there needs to be a
    link to a page which executes a PHP script which updates the database adding b....
  6. Need Help Is Adding A PHP Based News Module To My Site
    (2)
    Hey guys i need a simple help i'm builing a homesite and i have a little spot for news. Well i
    just place there the Topics and add a link to another page "news.php". Well its obvious that i dont
    want to build a file for each news that i have so i know that exists a way to work with SQL & PHP. I
    will show want i'm doing CODE        require ('mysql.php');       
    $query="SELECT * FROM News ORDER BY `data` ASC LIMIT 0,5 ";        $result=mysql_query($query);
               $num=mysql_num_rows($result); mysql_close(); echo " Outras Other News "; $i=....
  7. Link Counter
    (3)
    i have a game site and i wanted to know how can i create a link counter for every game i have and i
    want it all to use the same script not have to use like 10 diffrent scripts how can i make this or
    is there any site that offers the script for free? ....

    1. Looking for php, question, adding, link, inside, top, frame






*SIMILAR VIDEOS*
Searching Video's for php, question, adding, link, inside, top, frame
advertisement




Php Question Re Adding A Link - inside a top frame