Hi All,

I'm trying to access php-code on another url:

Local php-code test.php:

ob_start();
include( "http://www.mysite.eu/ext.php");

  echo "Local call!";
  echo "External call: ".GetExternal( );
ob_end_flush();
?>

And the code on the other url in ext.php:

<?php

function GetExternal( )
{
  $output = "This is external text";
  return $output;
}
?>

My page comes up with the error:
Local call!
Fatal error: Call to undefined function GetExternal() in D:\Develop\www\test\test.php on line 6

Can someone give me a hint on how to solve this ??

Thanks in advance!

Regards,
disc

Recommended Answers

All 2 Replies

Can't do that, has to be a local file. If you do an include() on a remote file it'll pretty much just gets the file like you would hit it in the browser. Remote file includes are just a bad idea all around.

oh may gloeh

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.