58 users online (0 members and 58 guests)  


  Results 1 to 7 of 7

Related

  1. iframe linking help.    Forum: HTML Forum
    Replies: 3
  2. Buttons Direct    Forum: HTML Forum
    Replies: 1
  3. using the URL to direct website visitors    Forum: Website Scripts Forum
    Replies: 2
  4. Replies: 8
  1. #1
    monc's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2013
    Posts
    3

    Direct linking to iframe src

    I've designed a website using an iframe. Let's say my website is SITE.COM. When you load SITE.COM, an iframe appears within the design that preloads SITE.COM/HOME.HTML. Within the design of SITE.COM, there are links that when clicked, manually load different pages within the iframe (ABOUT.HTML, BLOG.HTML, CONTACT.HTML, etc...). What I'd like to be able to do is provide people direct links to the "content" pages (with the outside-the-iframe design intact) for use on social media for instance, where clicking on them takes them to SITE.COM, but instead of loading HOME.HTML in the iframe, ABOUT.HTML loads for instance, or any other page I specify.

    I know I could achieve this by making a separate "main" page for every container page (SITE.COM/ABOUT could have the same design that appears on SITE.COM but ABOUT.HTML is automatically loaded in the iframe instead of HOME.HTML), but if I have many different content page (like separate pages for every blog post, etc...) I would be creating a lot of extra "main" pages on my website, which defeats the purpose of having the iframe. And I could, of course, eliminate the iframe all together, but I'd rather keep it.

    If there's a solution that let's me use just one main page and keep the iframe, I'd love to hear it.

    Thanks.

  2. #2
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Direct linking to iframe src

    Hi there monc,

    and a warm welcome to these forums.

    Instead of using the "iframe element", I would suggest that PHP includes would be a much better option.

    Does your host support it's use?

  3. #3
    monc's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2013
    Posts
    3

    Re: Direct linking to iframe src

    Thanks.

    And yes, my host (HostGator) supports PHP (PHP 5 according to their specs).

    Could you give me an example of a PHP INCLUDE code or point me in the direction of the easiest-to-understand information?

  4. #4
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Direct linking to iframe src

    Hi there monc,

    give me half an hour or so, and I will give you an example that you can upload to your host to try.

    You might also like to download...


    ...which would allow you to test files locally on your pc.

  5. #5
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Direct linking to iframe src

    Hi there monc,

    upload the "monc" folder, which you will find in the attachment, to your server to test it out.

    Of course, if you have installed "EasyPHP", then place the "monc" folder in the "www" folder of that program.
    Attached Files Attached Files

  6. #6
    monc's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2013
    Posts
    3

    Re: Direct linking to iframe src

    Thanks, coothead. I've never worked with PHP before, but I think, with a little tweaking, I can make it work in the design of my website.

  7. #7
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Direct linking to iframe src


    No problem, you're very welcome.