Jump to content

[SOLVED] require_once() across domains


iarp

Recommended Posts

I have this code in an index.php file on a friends server (http://moha.xabbu.net)

<?php
require_once('http://beta.iarp.ca/moha/'); # My server
?>

 

For some reason, whenever we view the page it's completely blank. If you look at the source code the entire page(on xabbu) is there. No clue why tho, any hints?

Link to comment
https://forums.phpfreaks.com/topic/150206-solved-require_once-across-domains/
Share on other sites

I'm trying to get a page from my domain iarp.ca to show on a friends subdomain xabbu.net.

 

At first i tried this code on moha.xabbu.net:

<?php
require_once('http://beta.iarp.ca/moha/');
?>

 

But that only resulted in a blank white page, and if you clicked CTRL+U to see the source code you ended up seeing the entire document source code but not the result. http://beta.iarp.ca/moha/ should be the visible result but as you can see on http://moha.xabbu.net it's completely blank and yet the source code is all there.

 

I tried this code with the same effect as above:

<?php
$homepage = file_get_contents('http://beta.iarp.ca/moha/');
echo $homepage;
?>

 

As taken from the php.net link in the first reply.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.