Guest donnie Posted July 1, 2006 Share Posted July 1, 2006 Hi, im doing a simple site and im pretty much total noob in PHP, just learning it so sorry[code]<div class="next"><?php @ require_once ("next.html"); ?></div><div class="navi"><?php @ require_once ("navi.php"); ?></div><div class="cont"><?php @ require_once ('./$page.html'); ?></div>[/code]So thats the code and what i want to do is that the menu (where all the links are) are in navi.php file. And when you click one of those links the page opens in "cont" box. But for some reason that doesnt work. Where's the problem. Im not sure but should i have somewhere something like $_GETthanks,donnie Quote Link to comment https://forums.phpfreaks.com/topic/13383-php-noob-problem-require_once/ Share on other sites More sharing options...
wildteen88 Posted July 1, 2006 Share Posted July 1, 2006 You'll probably want to use $_GET['page'] rather than $page like so:<div class="cont"><?php @ require_once './' . $_GET['page'] . '.html' ?></div> Quote Link to comment https://forums.phpfreaks.com/topic/13383-php-noob-problem-require_once/#findComment-51684 Share on other sites More sharing options...
Guest donnie Posted July 1, 2006 Share Posted July 1, 2006 Ah thats it. Thanks alot :) Quote Link to comment https://forums.phpfreaks.com/topic/13383-php-noob-problem-require_once/#findComment-51699 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.