Equivalent of iframe on server side


New Member
Is there any way to create an "iframe-like" on server side ? The fact is, I need to acceed to certains page of my society's intranet from our website's administration part.

I already have a SQL link to the database that works fine, but here I would access to the pages without duplicating the source code on the webserver.

My infrasructure is the following:

The Webserver is in a DMZ and has the following local IP: Our Intranet server is NOT in the DMZ and has the following IP:

Our Firewall has serverals rules and I've just added the following: DMZ->LAN Allow HTTP/HTTPStraffic and LAN->DMZ Allow HTTP/HTTPS (just as we've done for the SQL redirection)

I've tried the following PHP function:
$ch = curl_init();

// set URL and other appropriate options (also tried with IP adress instead of domain)
curl_setopt($ch, CURLOPT_URL, "http://intranet.socname.ch/");
curl_setopt($ch, CURLOPT_HEADER, 0);

// grab URL and pass it to the browser

// close cURL resource, and free up system resources
I've also tried:
$page = file_get_contents('');
echo $page;
But in all thoses cases, it works fine from local but not from internet. From internet, it doesn't load and after a while, says that the server isn't responding.

Thanks for your help !


Thành viên BQT
Your first and second solution could work. Can your webserver access (try ping on your webserver) or resolve the Hostname intranet.socname.ch ? (try nslookup intranet.socname.ch)

What you're looking for is called "proxy", here is a simple PHP project that I found:https://github.com/Alexxz/Simple-php-proxy-script

Download the repo, copy example.simple-php-proxy_config.php to simple-php-proxy_config.phpand change $dest_host = "intranet.socname.ch";

It should do the trick! (may also need to change $proxy_base_url)