PHP Assist
PHP Assist
- Started
- Last post
- 5 Responses
- xhanubis
Hey Guys,
I am using PHP require to include files into a template:
<?php require_once ("$page.html"); ?>
and calling it with:
template.php?page=babeuf
This is the error I am getting:
Warning: require_once(.html) [function.require-once]: failed to open stream: No such file or directory in /home/designby/public_html/demo... on line 1
Any Ideas what I am doing wrong?
- kingsteven0
<?php require_once ($page."html"); ?>
- kingsteven0
<?php require_once ($page.".html"); ?> even
- heavyt0
well, $page is actually in the $_GET array. your double quotes will do the trick, but you'll need to use "{$_GET['page']}.html"
- xhanubis0
Thanks for the assist guys, heavyt your code did the trick. King's code resulted in the same error but thanks to both of you.
- aye, i haven't used php in a while... forgot it doesn't make variables in a query string global any more...kingsteven
- kingsteven0
actually... what heavyt said...