PHP Include errors! How to fix?

Jon

New member
Hey, I'm getting lots of different errors when trying to include a file thats on the server and in the same directory. Basically.. the file is called "page.php?id=1".

I use this code:
<?php include ("/page.php?id=1"); ?>

I get this error:
Warning: include(/page.php?id=3) [function.include]: failed to open stream: No such file or directory in /home/jon/public_html/index.php on line 69

I use this code:
<?php include 'http://IPADDRESS/~jon/page.php?id=1'; ?>

I get this error:
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/jon/public_html/index.php on line 86

...I have tried editing the php.ini file with the allow_url_fopen and the other command for the php.ini file. Neither of them work for the external link! But I'm just soo confused to why when including the file locally, the server is saying the file isn't there but when I actually visit the url... it is! It's not in a subcategory!

All suggestions are much appreciated!

Cheers
Jon
@JoelKatz ...As I said, It is based within my server, hence why I can use the standard <?php include ="/page.php?id=1"?> code... The external link is infact a link to the php file on my server.
@mata ...Tried both of them, still the same error.
 
How you fix it depends on what you really want to do. Why would you want your server to run PHP code from someplace else? That's a massive security hole. You should put the PHP code you want to run on that server and include it by filename, not URL.
 
Back
Top