MartinHansell Posted June 29, 2007 Share Posted June 29, 2007 Hi, I am so new it's fantastic! Trying to use a simple list in a menu.php file as an include in all my pages. This is the code that I am using: <?php include("scripts/menu4.php");?> The file is included ok, but there is an added line with funny characters on it like this "". It renders differently in IE 7 and Firefox. IE7 creates the added line in the same content box kind half way up above the actual first line, whereas Firefox puts it above it's parent box. Not really sure what's causing it - any ideas??? I have loads of questions about the "best" way to produce menus/nav in web pages too.... My gut tells me that MySQL with PHP is a good way to go... if you have time can you point me in the right direction.. Many thanks Martin Quote Link to comment Share on other sites More sharing options...
phpknight Posted June 29, 2007 Share Posted June 29, 2007 Try making a different include file, either .inc or .php with just something simple and see if that works okay. If it does, it is probably something in the header itself. Quote Link to comment Share on other sites More sharing options...
MartinHansell Posted June 29, 2007 Author Share Posted June 29, 2007 Hi, Yeah, I've tried that, and the output is fine. Something in the header?? - in the html file? or the menu.php file? Cheers Quote Link to comment Share on other sites More sharing options...
phpknight Posted June 29, 2007 Share Posted June 29, 2007 It depends. I would guess menu php based on what you have said. To really figure it out, make two combinations: one with a simple html and menu.php, and one with a simple header and the regular html file. By what shows up, that will narrow down the problem for you. Then, post some code up here! Quote Link to comment Share on other sites More sharing options...
MartinHansell Posted June 29, 2007 Author Share Posted June 29, 2007 Hi, Like I said - very new!! t really sure what you mean by a header page? Here is my html code for a really slimmed down version of my page. I've tried it with and without the doctype header, but the css goes squiffy. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" hhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="style/HFWS_style_layout1.css"> <link rel="stylesheet" type="text/css" href="style/HFWS_style_text.css"> </head> <body> <div id="leftcontent"> <?php include("scripts/leftmenu1.php");?> </div><!--close leftcontent--> <div id="centercontent"> <?php include("test1.php");?> <?php include("test2.php");?> </div><!--close centercontent--> <div id="rightcontent"> <?php include("scripts/rightmenu1.php");?> </div><!--close rightcontent--> </body> </html> Here is the leftmenu1.php code: <ul> <li><a href="http://hansellfamily.homeip.net/index.php" title="Home">Home</a></li> <li><a href="news/index.php" title="Keep up with the times">News</a></li> <li><a href="about/index.php" title="Just who are the Hansell Family?">About us</a></li> <li><a href="gallery2/main.php?g2_itemId=81" title="A birds eye view of the family">Photos</a></li> <li><a href="blog/index.php" title="So what's a Blog?">Blogged up</a></li> <li><a href="language/index.php" title="Languages">Languages</a></li> <li><a href="education/index.php" title="Home education with a differnce">Educate me</a></li> <li><a href="culture/index.php" title="The impact of culture">Culture vulture</a></li> </ul> The other includes are exactly the same format just with either an <h1 /> or <p /> tag in them and some text. Even with this very simple structure the dodgy characters are still appearing... http://hansellfamily.homeip.net/indextest2.php (this is the page with the output....) Thanks a lot for taking the time! Martin ps - i am now going to try it without any css and see what happens. Quote Link to comment Share on other sites More sharing options...
phpknight Posted June 29, 2007 Share Posted June 29, 2007 LOL! By simple, I meant like a skeleton page with just hello world! or something. The point is to get the page without the error and then slowly add things until you catch it in the act. Quote Link to comment Share on other sites More sharing options...
suma237 Posted June 29, 2007 Share Posted June 29, 2007 with out css is the page is working? Quote Link to comment Share on other sites More sharing options...
MartinHansell Posted June 29, 2007 Author Share Posted June 29, 2007 hoho - that's simple. I've now stripped it down step by step until there is just one line on the html page (that is the php include statement) without even the <html /> or <body /> elements (the page is still rendering) and one line of text in the include file, with all sorts of .inc, .wink, and .stink extensions... still the same handshake when the page prints the line of text. Could it be in the setup of my php.ini file? Cheers ps - would have pointed you to o'reilly too on the apache stuff - hope you find what you are looking for! Quote Link to comment Share on other sites More sharing options...
phpknight Posted June 29, 2007 Share Posted June 29, 2007 Is that a question or a statement? Right now, don't worry about if the page works/looks like you want. Worry about finding the error. So besides including the php header, the html should just be this: <html> <head><title>test</title></head> <body> This is just a test! </body> </html> If you don't get the error, then it is not the php header. See what I mean? Quote Link to comment Share on other sites More sharing options...
MartinHansell Posted June 29, 2007 Author Share Posted June 29, 2007 yeah - take a look at this page to see my minimalist approach! http://hansellfamily.homeip.net/indextest3.php Quote Link to comment Share on other sites More sharing options...
phpknight Posted June 29, 2007 Share Posted June 29, 2007 That is very weird. What does the php header look like? Quote Link to comment Share on other sites More sharing options...
phpknight Posted June 29, 2007 Share Posted June 29, 2007 And that PHP file is not writing that test part with a print statement, right? That should just be plain text in the html file. If you send the html and php code, I can try checking this on my server. Quote Link to comment Share on other sites More sharing options...
suma237 Posted June 29, 2007 Share Posted June 29, 2007 create a new file (*.php) and check? Quote Link to comment Share on other sites More sharing options...
phpknight Posted June 29, 2007 Share Posted June 29, 2007 Yeah, try that. Personally, I use .inc, but I am not sure it makes any difference. Quote Link to comment Share on other sites More sharing options...
MartinHansell Posted June 29, 2007 Author Share Posted June 29, 2007 I have copy/pasted your sample code plus my php include statement into the html page and it's total contents now looks like this: <html> <head><title>test</title></head> <body> This is just a test!<br/> <?php include("test1.php");?> </body> </html> The sole contents of the php file are: This is the 1st include TEST file of the page ... and there is absolutely nothing in the file except this text string - is this correct? url again : http://hansellfamily.homeip.net/indextest3.php cheers Martin Quote Link to comment Share on other sites More sharing options...
MartinHansell Posted June 29, 2007 Author Share Posted June 29, 2007 oh, i tried a new file with .inc too - same result. No coy/pasting. A brand new file.... Quote Link to comment Share on other sites More sharing options...
phpknight Posted June 29, 2007 Share Posted June 29, 2007 That seems like an odd place for an include. BUT, no, the php file should say <?PHP print "This is just a test"; ?> In fact, if that does not work, try just putting this php statement in there by itself without including the file. See if that works. Quote Link to comment Share on other sites More sharing options...
suma237 Posted June 29, 2007 Share Posted June 29, 2007 ohhh....create a new file instead of index3test.php. after that you will be able to understand the problem. Quote Link to comment Share on other sites More sharing options...
MartinHansell Posted June 29, 2007 Author Share Posted June 29, 2007 Hi Suma, You are 1/2 right - the problem has gone... but I don't understand it.... You have been here before maybe? Many thanks - perhaps you can explain? Martin Quote Link to comment 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.