Jump to content


php noob problem - require_once


  • Please log in to reply
2 replies to this topic

#1 Guest_donnie_*

Guest_donnie_*
  • Guests

Posted 01 July 2006 - 01:35 PM

Hi, im doing a simple site and im pretty much total noob in PHP, just learning it so sorry

<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>

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 $_GET

thanks,
donnie

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 01 July 2006 - 01:42 PM

You'll probably want to use $_GET['page'] rather than $page like so:
<div class="cont">
<?php @ require_once './' . $_GET['page'] . '.html' ?>
</div>


#3 Guest_donnie_*

Guest_donnie_*
  • Guests

Posted 01 July 2006 - 03:08 PM

Ah thats it. Thanks alot :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users