dragon2309 Posted June 3, 2006 Share Posted June 3, 2006 Hi, i have a .htm file whihc contains SCRIPT src links to a javascript menu, this file is called menu.htm... On my index.php file i have a general layout set up using tables. In one of the table cells i have entered <?php include("menu.htm"); ?>This works fine, the menu gets displayed on the index.php file, only one problem, the menu gets displayed as it nwould do on the menu.htm file, theis means its butted up against the left hand side of the window, even though i put the INCLUDE function into the table cell, what i wanted it to do is shove the mune into the table cell (obviously it doesnt work like that)...So my question, is there any alternative to the INCLUDE function... or is there some parameter im missing?? Sorry, this probably sounds really n00bish, lol. Any help given is much apreciated.dragon Quote Link to comment https://forums.phpfreaks.com/topic/11106-php-include-function/ Share on other sites More sharing options...
wildteen88 Posted June 3, 2006 Share Posted June 3, 2006 If thats the result you are getting then you may not be coding your HTML correctly.include does what it is told to do, include a file thats it! The way you want the menu to look like is down how you style or code your HTML.Post your code here and we might be able to help.There is another alternative which is require but it'll probably do the same thing as include does. Quote Link to comment https://forums.phpfreaks.com/topic/11106-php-include-function/#findComment-41528 Share on other sites More sharing options...
dragon2309 Posted June 3, 2006 Author Share Posted June 3, 2006 ok, below is the code for my whole index.php page, you can see the tiny PHP block midway down in a cell - [code]<html><head><meta http-equiv="Content-Language" content="en-gb"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>CamberCaravan.co.uk</title></head><body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"><p></p><div align="center"> <table border="0" width="60%" id="table1" style="border-collapse: collapse" height="684"> <tr> <td colspan="2" height="202"><img src="img/mainhead1.jpg" width="800" height="200"></td> </tr> <tr> <td width="24%" height="90%"><?php include("menu.htm"); ?></php></td> <td width="76%" height="90%"> </td> </tr> </table></div></body></html>[/code]I cant see how else i would have to code it, surely it should be putting the menu inside that table cell???if you want to see a live version then go to [a href=\"http://www.cambercaravan.co.uk\" target=\"_blank\"]http://www.cambercaravan.co.uk[/a]cheers, dragon[b][u]*EDIT* - server is experiencing downtime, sorry, site unavailable[/u][/b] Quote Link to comment https://forums.phpfreaks.com/topic/11106-php-include-function/#findComment-41535 Share on other sites More sharing options...
poirot Posted June 3, 2006 Share Posted June 3, 2006 The "live" version is not working. The problem MAY be HTML related, and not PHP.Try to look into the source code, if the contents of menu.htm are IN THE cell, this means PHP did its part. Quote Link to comment https://forums.phpfreaks.com/topic/11106-php-include-function/#findComment-41539 Share on other sites More sharing options...
dragon2309 Posted June 3, 2006 Author Share Posted June 3, 2006 ok, yeh, server is messing about at the moment, i checke the source, and your right, the contents of menu.htm ARE NOT in the cell, it is simply shoved at the bottom of the code when index.php finishes.... which is strange.... how do i get it to actually shove all of menu.htm INTO THE CELL, and not just ina seemingly random place...cheers, dragon Quote Link to comment https://forums.phpfreaks.com/topic/11106-php-include-function/#findComment-41544 Share on other sites More sharing options...
dragon2309 Posted June 3, 2006 Author Share Posted June 3, 2006 any ideas anyone...? Quote Link to comment https://forums.phpfreaks.com/topic/11106-php-include-function/#findComment-41563 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.