Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have tried you below code and its working as expected.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;script type="text/javascript" src='js/jquery.js'&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; $(function(){ $('div').load('x-request.php?url=maps.google.com'); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> <p><strong>php code</strong></p> <pre><code>&lt;?php echo file_get_contents('https://' . $_GET['url']); ?&gt;</code></pre> <p>Its loading Google map without any error.</p> <p><strong>Edit</strong></p> <p>In response of comment following are the possible best solutions.</p> <p>The setting you are looking for is <code>allow_url_fopen</code>.</p> <p>set <code>allow_url_fopen = On </code> in php.ini file.</p> <p>You have two ways of getting around it without changing php.ini, one of them is to use <a href="http://php.net/manual/en/function.fsockopen.php" rel="nofollow">fsockopen</a>, and the other is to use <a href="http://php.net/manual/en/book.curl.php" rel="nofollow">cURL</a>.</p> <p><strong>curl example</strong></p> <pre><code>function get_content($URL) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $URL); $data = curl_exec($ch); curl_close($ch); return $data; } echo get_content('http://example.com');</code></pre> <p>Quick reference links are as below for curl.</p> <p><a href="http://www.kanersan.com/blog.php?blogId=45" rel="nofollow">http://www.kanersan.com/blog.php?blogId=45</a></p> <p><a href="http://www.tomjepson.co.uk/enabling-curl-in-php-php-ini-wamp-xamp-ubuntu/" rel="nofollow">http://www.tomjepson.co.uk/enabling-curl-in-php-php-ini-wamp-xamp-ubuntu/</a></p> <pre><code>&lt;php $ch = curl_init();// set url curl_setopt($ch, CURLOPT_URL, $_GET['url']); //return the as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch,CURLOPT_BINARYTRANSFER, true); // echo output string $output = curl_exec($ch); $url = $_GET['url']; $path = 'http://'.$url.'/'; $search = '#url\((?!\s*[\'"]?(?:https?:)?//)\s*([\'"])?#'; $replace = "url($1{$path}"; $output = preg_replace($search, $replace, $output); echo $output; // close curl resource to free up system resources curl_close($ch);</code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload