Can I use something like this to get a page that is external to the domain.
<?php $q_pass =$_REQUEST['query_passed']; $fetcher = "http://www.abc.com/search?q=".$q_pass; $homepage = file_get_contents($fetcher); echo $homepage; ?>
I passed a variable and want to get the result from abc.com. Can $ fetcher be passed to get_contents to retrieve page content? I get a blank page when I get to this php page. But its working fine again if I use something like
<?php $fetcher = "http://www.abc.com/search?q=query"; $homepage = file_get_contents($fetcher); echo $homepage; ?>
What's going on here? Is there any technical explanation for this?
source share