PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Greetings all, I'm a newcomer to the forum, however been with PHP for a while and have come across this problem. The code returns the following errors:
Warning: include_once(page/add.php?id=3) [function.include-once]: failed to open stream: No such file or directory in /asset/function.php on line 18
Warning: include_once() [function.include]: Failed opening 'page/add.php?id=3' for inclusion (include_path='.:/usr/local/php5/lib/php') in asset/function.php on line 18
The thing is when I remove everything past the '?' everything works as it should. Can I not use the question mark with an include, and if not can someone suggest a better way of going about this?
Many thanks,
Doc
Last edited by Benjamin on Fri May 29, 2009 10:20 am, edited 1 time in total.
Reason:Changed code type from text to php.
tries to open a file named "add.php?id=3". This is not a valid file name, hence the error.
The include_once statement and its siblings are control structures like if and else except that they are used to include code from other files on the filesystem. They do not (usually) issue HTTP requests.
<?php
include_once 'http://127.0.0.1/get.php?echo=hello';
// If your server requires authentication:
//include_once 'http://username:password@127.0.0.1/get.php?echo=hello';
?>