html - PHP and Curl not Returning Output with Variable -
here index.php file...
<?php // defining basic curl function function curl($url) { $ch = curl_init(); // initialising curl curl_setopt($ch, curlopt_url, $url); // setting curl's url option $url variable passed function curl_setopt($ch, curlopt_returntransfer, true); // setting curl's option return webpage data $data = curl_exec($ch); // executing curl request , assigning returned data $data variable curl_close($ch); // closing curl return $data; // returning data function } $url1 = $_get['link']; $response = curl($url1); $response = str_replace("./views","http://movietube.pm/views",$response); $response = str_replace("./lib","http://movietube.pm/lib",$response); $response = str_replace("./assets","http://movietube.pm/assets",$response); echo $response; ?> // defining basic curl function function curl($url) { $ch = curl_init(); // initialising curl curl_setopt($ch, curlopt_url, $url); // setting curl's url option $url variable passed function curl_setopt($ch, curlopt_returntransfer, true); // setting curl's option return webpage data $data = curl_exec($ch); // executing curl request , assigning returned data $data variable curl_close($ch); // closing curl return $data; // returning data function } $url1 = $_get['link']; $response = curl($url1); $response = str_replace("./views","http://movietube.pm/views",$response); $response = str_replace("./lib","http://movietube.pm/lib",$response); $response = str_replace("./assets","http://movietube.pm/assets",$response); echo $response; ?> basically, want take input www.example.com?link=(link) , return html of page, after executing php... on output, loads page correctly, doesn't put in tv show stuff, video player, links, or episode director...
what does...
http://muchmovies.uphero.com/?link=http://www.tvstreaming.cc/watch.php?v=tgmi0opy0cc
what want do...
http://www.tvstreaming.cc/watch.php?v=tgmi0opy0cc
any appreciated!
maybe have problem php variable $_get['link'] because put link:
http://muchmovies.uphero.com/?link=http://www.tvstreaming.cc/watch.php?v=tgmi0opy0cc
and note query string this: ?link=http://www.tvstreaming.cc/watch.php?v=tgmi0opy0cc
this query string must encoding , not encoding it, so, variable $_get['link'] not have value need curl.
i recommend 2 options:
- encode url params
- or, pass url using base64 encode on server use base decode
please, tell me if solution.
Comments
Post a Comment