1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help With PHP clone page

Discussion in 'PHP & Perl' started by stealth, Feb 7, 2009.

Tags:
  1. stealth

    stealth Newbie

    Joined:
    Feb 29, 2008
    Messages:
    4
    Likes Received:
    0
    Hi,

    I am trying serve an affiliate page on my website using the following code
    Code:
    <?php
    $file = file_get_contents ('hxxp://affiliate_site/');
    Echo $file;
    ?> 
    It pulls the page text fine, but I am not getting any of the images from the original page, due too they are referenced ./images and I think the page I am pulling is trying to get the images from my site.

    Is there a way to get these images, via PHP, without downloading them to my site?

    Thanks
     
  2. undeterminederror

    undeterminederror BANNED BANNED

    Joined:
    Mar 31, 2008
    Messages:
    630
    Likes Received:
    457
    I'd also wanna know this.
     
  3. cyrix

    cyrix Junior Member

    Joined:
    Sep 19, 2008
    Messages:
    179
    Likes Received:
    61
    Occupation:
    Full Time Internet Marketer\Developer
    Location:
    United States
    i would parse $file once its been received, write a script to go through the code and find the images. Then when the src property is found, stick the website url in front of it and then echo it to your page.

    example:
    Before: <image src="./background.png"></image>
    After: <image src="http://www.mysite.com/./background.png"></image>
     
  4. distributed

    distributed Newbie

    Joined:
    Dec 7, 2008
    Messages:
    20
    Likes Received:
    0
    this is not so good method - if you have forms, you need to fix them too, images are easy fixed with mod_rewrite (check docs).
    if your affiliate tracks domain where customer came research on mod_proxy and simply setup domain as proxy for affiliate.com
     
  5. stealth

    stealth Newbie

    Joined:
    Feb 29, 2008
    Messages:
    4
    Likes Received:
    0
    Gives me some additional areas to research...Thanks
     
  6. stealth

    stealth Newbie

    Joined:
    Feb 29, 2008
    Messages:
    4
    Likes Received:
    0
    ok...thanks for the info...I'm gonna be busy figuring this out :eek: maybe I will stick with iFrames LOL.
     
  7. lokiceo

    lokiceo Registered Member

    Joined:
    Jul 26, 2008
    Messages:
    77
    Likes Received:
    30
    Location:
    WI
    You can use curl do this.

    Check out blog.unitedheroes.net/curl/ and read the first part about what _not_ to do.

    If you are doing this server-side though, I think your AM is going to see your server's IP going to the offer a bunch of times rather than your visitor's.
     
    • Thanks Thanks x 1