Question:

Create a hyperlink to a page within a frame?

by  |  earlier

0 LIKES UnLike

HI, I have a web site which has a banner and contents frame pages, however I want to set up a link in an email flyer that has a link to a specific page. When I try this it just opens the main default page that people arrive at when opening the viewing the site. Any ideas?

 Tags:

   Report

3 ANSWERS


  1. have you specified the name of your target frame?

    (e.g. <FRAME NAME="him"> or <A HREF="http://yahoo.com/" TARGET="him">)


  2. In order to do this, you'll need to use a programming language like PHP or ASP. With just HTML and CSS, it's not possible.

    If the host your website is on supports PHP, you can use variables in the address bar. So, instead of linking to www.yourwebsite.com/index.php, you can link to www.yourwebsite.com/index.php?page=about...

    In PHP, you can then use the variable $page to open the frame page you requested, or the default one if $page is empty.

    <?php

    if($page != '') { $frame_page = $page; }

    else { $frame_page = 'default_page.html'; }

    ?>

    <frame src="<?=$frame_page;?>">

    Not the most accessible solution for someone who hasn't ever worked with PHP before. A simpler solution might be to create multiple 'frameset' pages, each one with a different page as the default frame.

  3. <a href="http://yourwebsite.com/page.html" target="_top">link</a>

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.