Jump to content

Archived

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

cappsie

PHP and Tables

Recommended Posts

Hi

I have a page that is contained within a large table.

I have been wanting to swtich to php for the convenience of not having to edit lots of pages.

Alas it has not proven sucessful - I only want to use very simple php to call in to my main page php pages/docs.

For some reason I am having trouble doing this as when I design the main page with the tag:
[b]<div class="body"><?php @ require_once ("$page.php"); ?></div>[/b]

It only loads half the page - the tutorials I have read haven't made good sense.

Is there a step by step guide around here that includes a "rule of thumb" and "best practice" guide?

alternatively if someone fancies helping me out it would save me much time - it is only very simple my aim :)

I have 6 main page links and within each page are many other links -
the main (parent) pages need to be able to list the child links and the child links have to have the ability to 'call' the php info pages into and below those child links.

I hope that is clear  :-\

Anyways thanks in advance
:)

Adam

Share this post


Link to post
Share on other sites
Oh and unless the same file is going to be included more than once, you can just use require()

Share this post


Link to post
Share on other sites
The main diff between include and require is
if an include fails to include, the script continues
if a require fails to include, the script stops

Share this post


Link to post
Share on other sites
Require returns a fatal error, thus halting the script half way. But cose of that @ you don't see the error... Include would just produce a warnig, and let the script run to it's end.

I'm slow at typing  ;D

Share this post


Link to post
Share on other sites
I think most of that makes sense.

Your require call is a little off however.  Try:
<div class="body"><?php @require_once ("page.php"); ?></div>

If you're including a dynamic page, you can do this:
<div class="body"><?php @require_once ($page . ".php"); ?></div>

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.