Results 1 to 16 of 16

Thread: iFrame based on link
      
   

  1. #1
    Join Date
    Jan 2008
    Posts
    44

    Default iFrame based on link

    Ok I don't know if this is possible, but if there's any way I can accomplish this, it will save me hours upon hours of wasted time.

    What I want to do is create a page that has a purpose of framing in a link that is included in the actual url, that could be manipulated by simply changing the framed link in the entire url

    For example, if I want to frame in www.google.com into this page, Is there a way that I could use a link like: www.franketeam.com?frame=http://www.google.com and have something on the page reference that part of the link, and open it in a set area in an iFrame.

    Right now I basically have to create a separate page for every link I want to frame, (ex. www.franketeam.com/lake-conroe-waterfront-homes.html) but I have hundreds more that I want to create, so as you can see, this would be a life saver... If you need further explaination let me know. Thanks in advance!

    Jacob

  2. #2
    Join Date
    Jan 2008
    Posts
    44

    Default Re: iFrame based on link

    Ok I did some more digging, and almost have it working... I used the below code in an HTML insert and it works if I use a link like the following:

    http://www.franketeam.com/frame.php?...onroesubs.html

    However, it's only working if I give path a value of a page on my site, but if I put in a link:

    http://www.franketeam.com/frame.php?...www.google.com

    I get the 406 Not Acceptable error...

    Anyway please let me know if anyone knows why. Thanks!

    Code:
    <?php
    $path = $_GET['path'];
    echo "<iframe src='$path' width=750 height=1500 frameborder=0></iframe>";
    ?>

  3. #3
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,294

    Default Re: iFrame based on link

    Its not a case of jumping in at once..........PHP is not everyones cup of tea so if a member dosnt know the answer he/she will not jump in.

    Navaldesign could answer this one, but he is one busy gentleman.

    Try some of the specialized PHP sites in google whilst you are waiting.

  4. #4
    Join Date
    Jan 2008
    Posts
    44

    Default Re: iFrame based on link

    Oh no I'm not complaining or anything, I just feel like I'm so close!

    Ok I have narrowed it down further, I believe the issue isn't with php or anything wrong with the code, I think it has to be something to do with my account, because another friend of mine uploaded the exact same .php file to his account and it works great. He is also using vodahost:

    http://www.franketeam.com/test/hatre...www.google.com (doesn't work)

    http://www.hodumup.com/test/hatred.p...www.google.com (works great)

    They are identical files... I even created a test folder with the same permissions (I've tried them all, they just cause 500 Internal Server Errors)so I'm totally lost at this point as to what could cause this unless there is some setting on my account that is different whether in or out of my control...

  5. #5
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,294

    Default Re: iFrame based on link

    Send me the php file and the test bv page and I will test it as well for you, pick my email up from the members club or below my siggy.

  6. #6
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: iFrame based on link

    A 406 error usually has to do with the sec_mod of your server. Are you and your friend on the same server? If not, that could be a possible explanation. I have had this problem recently, with a csript i installed on such a server.

    Walk around:

    Place the iframe in your page. Make it the size you like.
    Make the links that lead to the page, simply contain the domain name in example "google.com"

    Now, in the iframe properties dialog box, put this:

    <? echo $link;?>

    Right click the Iframe, select HTML and in the Before Tag paste the following:

    <?
    $link = "http://www.".$_GET['path'];
    ?>


    This way you will avoid the http:// which triggers the servers defences.

    Live example: http://www.dbtechnosystems.com/Tips/...hnosystems.com

    Change the final part to whatever you like (in example "google.com" or "vodahost.com" to see how it displays the site passed through the GET method.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  7. #7
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,294

    Default Re: iFrame based on link

    done all above Geoge and getting

    The requested URL /google.com was not found on this server

    iframe link = <? echo $link;?>

    The Before Tag =

    <?
    $link = "http://www.".$_GET['path'];
    ?>

    Two test links were:

    google.com
    unionsinfronteras.com

    The requested URL /google.com was not found on this server
    same result with the 2nd link............

    Could do with getting this idea working myself !! as I have a few hundred photos to deal with.

    Where does this part come into the equation:
    http://www.dbtechnosystems.com/Tips/...hnosystems.com

    As you advised above to make the link google.com on its own ?

    What have I missed or not understood?

  8. #8
    Join Date
    Jan 2008
    Posts
    44

    Default Re: iFrame based on link

    As usual you are awesome (It worked for me David, might be something else keeping yours from working though), however, as usual solving one problem reveals another for me.

    One of the sample links I was creating this function for is below:

    http://www.franketeam.com/frame.php?...division=april

    The problem is, it removed everything after one of the & indicators... do you know if there is a workaround for this? Even if they fix the sec_mod problem, I tested it on one of my other accounts and it had the same result.

  9. #9
    Join Date
    Jan 2008
    Posts
    44

    Default Re: iFrame based on link

    Hey David,

    I think his link(http://www.dbtechnosystems.com/Tips/...hnosystems.com) was just to show a working sample.

    Do you have a link to the page you have set up? I feel like after all my research I might be able to spot something that could cause that.

  10. #10
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,294

    Default Re: iFrame based on link

    Where does this part come in:
    path_frame.php

    I am assuming that you have a php script named path_frame....yes?

  11. #11
    Join Date
    Jan 2008
    Posts
    44

    Default Re: iFrame based on link

    That's just the name of the page he created the frame on I believe. In my case I created a page named frame.php to host the iframe, etc. so the link ended up being:

    http://www.franketeam.com/frame.php?path=vodahost.com

    So if you just create a php page, and place the iframe there with the work around he mentioned, you should just have to ad "?path=google.com" at the end of that page name.

    If it still doesn't work for you, and you don't have the problem I was having with the mod security, you can just insert an html box on a php page, and paste the following code in it:

    Code:
    <?php
    $path = $_GET['path'];
    echo "<iframe src='$path' width=750 height=1500 frameborder=0></iframe>";
    ?>
    Then just add "?path=http://www.google.com" to the end of your page name.

  12. #12
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,294

    Default Re: iFrame based on link

    Thanks jacobhebert

    Your last post made it clear and I now have it working the way George explained it..................Your still the king George...........Thanks.

  13. #13
    Join Date
    Jan 2008
    Posts
    44

    Default Re: iFrame based on link

    Glad I could help!

    Now, does anyone know if there's a way to convert the Ampersand (&) in the link I'm trying to frame, or to make sure the php function doesn't drop everything after the first ampersand?

    If so let me know! This is an example of one such link:

    http://search.har.com/idx/dosearch.c...division=april

  14. #14
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,294

  15. #15
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: iFrame based on link

    Quote Originally Posted by jacobhebert View Post
    As usual you are awesome (It worked for me David, might be something else keeping yours from working though), however, as usual solving one problem reveals another for me.

    One of the sample links I was creating this function for is below:

    http://www.franketeam.com/frame.php?...division=april

    The problem is, it removed everything after one of the & indicators... do you know if there is a workaround for this? Even if they fix the sec_mod problem, I tested it on one of my other accounts and it had the same result.
    This will NOT work because it ALREADY contains a set of GET info (all the part after your ? ) so it will not work this way. When this is the case, you need a code that is a bit more complicated, exploding the entire link through using the "?" as needle, and using the first part as site and the second as parametrers to pass through to the site that must be displayed in the Iframe.

    The code in the Before tag should become :

    <?php
    $keys = array_keys($_GET);
    $link = "http://www.".$_GET['path'];
    for ($i = 1; $i < count($_GET); $i++){
    $link .= $keys[$i]."=".$_GET[$keys[$i]]."&";
    }
    ?>

    Check this out:

    http://www.dbtechnosystems.com/Tips/...division=april
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  16. #16
    Join Date
    Jan 2008
    Posts
    44

    Default Re: iFrame based on link

    Thanks for the reply, I actually tried manually replacing all of the &'s with &amp, and then with %26 but all had the same result.

    Ok scratch that! I did try viewing a regular page with all %26's replacing the &'s and it gave me the same error, but I just tried the actual frame and it works when framing it... So now I just have to code in something to make that swap!

    UPADTE:

    Just caught your post in between George, thanks so much again, you have saved me a ton of time for like the 3rd time today.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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