View Full Version : iFrames help

12-07-2005, 12:51 AM

I have a website where the header adn footer are located in the index page, i use a javascript as a menu and an iframe to display the main body of the page. The java script calls pages within the iframe.

I would like to sent an e-mail with a hyperlink to my website, but would like the iframe to display a different source page, not the initial page.

Is this possible, if so could you please tell me how this can be done!


for ref my website is www.wiso.net.

12-07-2005, 03:39 AM
I'm thinking that you may have to use a server-side script to set the
proper page that needs to be loaded into the <iframe>.

Since the person is entering your site from an email link, the email link
is going to be a call to a PHP (or Perl) script that sets a cookie and then
redirects to your main page. Your main page reads the cookie using
Javascripting and loads the correct HTML into the <iframe>.

Example ... if you sent me an email, I would see a link like this:

When I click the link, it would run a php script called "login.php".
That script would set a cookie with a value of "site1.html" and
then redirect to your main page.

Using Javascripts, your main page would read the cookie and then it
would know which page to load.


You would need to know two things.

1) How to make a PHP script set a cookie and redirect to another page.

2) How to use Javascript to read a cookie and use that value.

Both of these things can be learned by tutorials (search Google).


If anyone has Javascripting turned off, the method would fail ...
but then again, you're using Javascripting now anyhow.