Help: Set false site root.

Discussion in 'PHP' started by websiteads, Apr 17, 2008.

  1. #1
    Hi all, I'm messing around with cURL and have the following code:

    <?php
    
    $curl_handle=curl_init();
    curl_setopt($curl_handle,CURLOPT_URL,'http://youtube.com/watch?v=EwnlRATD3Jk');
    curl_exec($curl_handle);
    curl_close($curl_handle);
    
    ?>
    PHP:
    This generates the following page: http://123easy.eu/test/

    The videos don't show up on that page because the source of the embedded video player is linked to by "/player2.swf", so instead of loading the swf file from "http://youtube.com/player2.swf" it loads it from "http://123easy.eu/player2.swf". I was wondering if there is a way to set a false root directory or use cURL to change all the "/" links to "http://youtube.com/".
    Any help is appreciated.
    Thanks.
     
    websiteads, Apr 17, 2008 IP
  2. Louis11

    Louis11 Active Member

    Messages:
    783
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    70
    #2
    Why not just preg_replace() (or str_replace() ) for all of the instances of the src for the embed?, so change the / to a http://youtube.com/

    That should do the trick! :)
     
    Louis11, Apr 17, 2008 IP