Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9159587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:31:46+00:00 2026-06-17T13:31:46+00:00

I want load a domain url in div element I have 2 problems :

  • 0

I want load a domain url in div element

I have 2 problems :

  • if load a domain for example ‘google.com’ with http protocol don’t load address images correctly, but load page !
  • if load a google map with https protocol give warning and don’t work never !

Here is my code :

load.php

<html>
<head>
    <title></title>
    <script type="text/javascript" src='jquery.js'></script>
</head>
<body>
    <div></div>
    <script type="text/javascript">
        $(function(){
            $('div').load('/x-request.php?url=googleMapAdress');
        });
    </script>
</body>
</html>

x-request.php

<?php
    echo file_get_contents('https://' . $_GET['url']);
?>

Note: I don’t want to use iframe tag & my code must have ajax code!

What is the solution?

//more explain

How get any external page and load it in div element completely ?
this is means => href, src and all links work truly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:31:48+00:00Added an answer on June 17, 2026 at 1:31 pm

    I have tried you below code and its working as expected.

    <html>
    <head>
        <title></title>
        <script type="text/javascript" src='js/jquery.js'></script>
    </head>
    <body>
        <div></div>
        <script type="text/javascript">
            $(function(){
                $('div').load('x-request.php?url=maps.google.com');
            });
        </script>
    </body>
    </html>

    php code

    <?php
        echo file_get_contents('https://' . $_GET['url']);
    ?>

    Its loading Google map without any error.

    Edit

    In response of comment following are the possible best solutions.

    The setting you are looking for is allow_url_fopen.

    set allow_url_fopen = On in php.ini file.

    You have two ways of getting around it without changing php.ini, one of them is to use fsockopen, and the other is to use cURL.

    curl example

    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');

    Quick reference links are as below for curl.

    http://www.kanersan.com/blog.php?blogId=45

    http://www.tomjepson.co.uk/enabling-curl-in-php-php-ini-wamp-xamp-ubuntu/

    <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);
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use mod_rewrite with PHP, parse the URL with this format: http://www.domain.com/Path-to-index.php/Class_to_Load/Function_to_Execute/Arguments_as_array_to_the_function
I actually have two websites on the same domain. say, for example http://www.abc.com/flashsite &
I need to load cross-domain JavaScript files dynamically for bookmarklets in my site http://jsbookmarklets.com/
In my domain example.com , I want to put all page files in a
I want to load data from MySql database to a HTTP form When I
I want to load a palette from a bitmap file I have created. The
I'm defining a partner through a route based on the url e.g. my.domain.com/:partner/:controller/:action Now
How do get the hash url to output something cleaner? Its doing this: domain.com/#/page/1
I have a gallery for my website (mysite.com) as a sub-domain (gallery.mysite.com) but I
I have a website at http://www.link1.com where all the php and images are, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.