How to use the client ip in file_get_contents

1

I made a script that extracts the link from any video that is hosted on mp4upload, only when the link is extracted the ip from my site that is identified. What I wanted to know how does that make the client ip to be identified? I've tried using curl but it did not work: /

<?php
$url = 'http://www.mp4upload.com/embed-'.$_GET['id'].'.html'; //:D 
$v=@file_get_contents($url);
$source = explode("'file':", $v);
$source = explode(',', $source[1]);
$source = explode("'", $source[0]);
foreach($source as $link){$source = $link;if($source!=''){echo $video = $source;}} 

?>
    
asked by anonymous 27.06.2015 / 02:22

1 answer

0

In a short answer It is not possible to do this via PHP, as well as:

  • Your browser is client of your PHP server.
  • PHP will be client of mp4upload.

In other words, it is your server that is picking up the data and then passing it on to your browser.

The only way to do this would be to do this in the front-end , using JavaScript for example, but there is still another problem with this, for security browsers block requests from one server on another ( read about CORS ).

In other words, you can not force mp4upload to add the headers to enable CORS , unless they have an API for developers like us I found no API) or it's also not possible to do this via javascript (front-end)

    
27.06.2015 / 07:05