TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Php question re: includes

Page: 1 Reply
Jul 31st 2001#10911 Report
Member since: Mar 18th 2001
Posts: 6
Following Bobs tutorial.

Say I want to include my navigation menu which has dhtml drop down menus. How would I include that code? Is there any specific format. Usually your scripts go inside the Head tag?


http://www.epitimy.com/callcenter.htm
Reply with Quote Reply
Jul 31st 2001#10981 Report
Member since: Mar 18th 2001
Posts: 1452
You can include anywhere in your code.

Say you have a standard 2 column table:

table
tr
td

MENU CODE HERE
MENU CODE HERE
MENU CODE HERE
MENU CODE HERE

/td

td

CONTENT HERE
CONTENT HERE
CONTENT HERE
CONTENT HERE

/td
/tr
/table

You would take MENU CODE HERE x4, and add it to a file, say menu.php. Then add the include tag to your table, to look like this:

table
tr
td

<?
include('menu.php');
?>

/td

td

CONTENT HERE
CONTENT HERE
CONTENT HERE
CONTENT HERE

/td
/tr
/table

Just add that include to every page the menu should be on, then you'll only have to change that 1 file down the road.
Reply with Quote Reply
Jul 31st 2001#11056 Report
Member since: Mar 18th 2001
Posts: 6
Right, but I'm using DHTML drop down menus in the table that I'm including so how could I include the function that would normally go in the head tags?
Reply with Quote Reply
Aug 1st 2001#11218 Report
Member since: Mar 18th 2001
Posts: 1452
Just add it like normal.

Once all the code is outputted to the browser, it will all look as if you hadn't used any includes, and everything will work as usual.
Reply with Quote Reply
Aug 6th 2001#11784 Report
Member since: Mar 18th 2001
Posts: 87
I have a question related to this topic...

What would cause the included file not to appear at all? I switched back to html without includes becouse of complaints of the menu (included file) not showing up at all. I tested with ie5.5 netscape4.7/6 on win2k and had no problems. I could not duplicate the problem people were telling me about.

Is it most liely a code error, server error, or old browser/os symptom?
Reply with Quote Reply
Aug 6th 2001#11791 Report
Member since: Jun 30th 2001
Posts: 447
It could be a code error, but I've never had any problems with PHP choking on includes. Most likely it's an old browser/os problem. Myabe they pressed the stop button??
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum