Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest donnie

php noob problem - require_once

Recommended Posts

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

thanks,
donnie

Share this post


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

Share this post


Link to post
Share on other sites
Guest donnie
Ah thats it. Thanks alot :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.