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 8004287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:52:23+00:00 2026-06-04T16:52:23+00:00

I am experiencing some very strange behavior when including a php file. I need

  • 0

I am experiencing some very strange behavior when including a php file.
I need to load a script that is not on the same domain as the page that will be calling it.

I have already created a system that works using cURL, but I just recently found out that many of the sites that will need to have access to this script, do not have cURL installed.
I did, however, notice that these sites have allow_url_fopen set to on. With this knowledge I got started creating a new system that would let me just include the script on the remote site.

Just testing this out, I coded the script test.php as follows:

<?php 
echo("test");
?>

I include this script on the remote page using:

<?php
include("http://mydomain.com/script.php");
?>

and it works no problem and “test” is printed at the top of the page.

However, if I add a function to the script and try to call the function from the page, it crashes.
To make it worse, this site has php errors turned off and I have no way of turning it on.

To fully make sure that I didn’t just mess up the code, I made my test.php look like this:

<?php
function myfunc()
{
return "abc";
}
?>

Then on the page including the file:

<?php 
include("http://mydomain.com/script.php");
echo(myfunc());
?>

And it crashes.
Any ideas would be greatly appreciated.

  • 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-04T16:52:24+00:00Added an answer on June 4, 2026 at 4:52 pm

    This is not odd behavior, but since you load the file over the internet (note in this case the World Wide Web), the file is interpreted before it is sent to your include function.

    Since the script is interpreted no functions will be visible, but only the output of the script.

    Either load it over FTP or create an API for the functions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am experiencing some very strange behavior with Blend: Since weeks i am working
I am experiencing some very odd timing behavior from a function I wrote. If
I'm experiencing some strange behavior for which I can't find any documented knowledge. Here's
I am experiencing some strange behavior with SQL Server CE 3.5 SP2. I have
I am recently experiencing some very strange behavious with Fash Builder 4.5. Sometime it
I am experiencing some very strange mouse-event behaviour when working with Silverlights DataGrid: What
I am experiencing very difficult (hard to find) problem with my PHP login script.
I'm experiencing a very odd upload problem. Here's the relevant view file: <form action=http://localhost/index.php/temp/upload/
I am experiencing some performance problems when creating a very simple Python HTTP server.
I'm experiencing some problems while trying to read a binary file in C. This

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.