Hi,

I have several hundred html links in a file "main.html" pointing to external websites. ie: "external.html"
When a user clicks an external link from within "main.html", I want to bring up "external.html" in all its glory, but with a banner / header across the top (I am guessing iframe is a good option) - so effectively the link will take us to "frame.html", with "banner.html" and "external.html" in an iframe (or alike).

The banner has to be populated with information specific for that "external.html" file.
ie: when they click on the link to "external_1.html", the header might have the text "external_1".

So, I am happy with doing this as a one off, but can't see the method to have a single 'onclick' script to pass the required information from "main.html" to "frame.html", and then for "banner.html" to be updated with the text passed from the 'onclick', and to know to call in the correct "external" to populate the iframe.

I will further complicate it by asking if it is possible to have all the scripting required contained within "main.html"?

Its a big ask - but I appreciate your help.

Cheers,
Matt

there are 2 ways:
1. using php:
- change the links in the "main.html" to: "frame.php?link=external_1.html&title=External 1" where external.html is your link and External 1 is the banner-title
- create a php-file named "frame.php" and use some code like this:

<div id="banner"><h1><?php echo $_GET['title']; ?></h1></div><iframe src="<?php echo $_GET['link']; ?>" />

2. Creating for every external link a html-file and design it with banner & iframe

i recommend number 1

Hope it will help,
Agarsia

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.