Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: iFrames help

  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Thanked 0 Times in 0 Posts

    iFrames help


    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.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Cottage Grove, Minnesota
    Thanked 1,096 Times in 1,087 Posts
    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.
    Last edited by mlseim; 12-07-2005 at 03:55 AM.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts