I am using include to add a piece of code to a page and I want to choose which code via a query in the URL string.
The code I am using is:
include("functions/{$page}");
For example, if a user goes to http://www.mysite.com/index.php?code=register.php then the code included would be from register.php.
But I am getting this error with the above code:
Warning: main(functions/{$page}): failed to open stream: No such file or directory in /home/jclickth/public_html/page_test.php on line 0
Warning: main(functions/{$page}): failed to open stream: No such file or directory in /home/jclickth/public_html/page_test.php on line 0
Warning: main(): Failed opening 'functions/{$page}' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jclickth/public_html/page_test.php on line 0
Can anyone help me out?