makaveli Posted December 11, 2006 Share Posted December 11, 2006 i remember SSI could load in an external file, so you could say tell it to ><!--#include file=/web design/navigation.html" --> and it would include the navigation bar in your page, advantages of this were if you needed to add something at a later date you could do this changing one file not many, it was also good for say footers where © 2006 would need to be 2007 soon. anyways, how do i do this in php, i tried a code, it worked but none of the images worked. if it helps im making these using slices from imageready and putting nav.php in a frame the code i used (and i think its wrong) is ><div id="Layer2"> <?include("nav.php"); ?> </div> ive looked on php sites but "techno babble" just confused me Quote Link to comment Share on other sites More sharing options...
TCH-Thomas Posted December 11, 2006 Share Posted December 11, 2006 I can be wrong, but try: ><div id="Layer2"> <?php include 'yourfile.php'; ?> </div> Quote Link to comment Share on other sites More sharing options...
TCH-Don Posted December 11, 2006 Share Posted December 11, 2006 change ><div id="Layer2"> <?include("nav.php"); ?> </div> to ><div id="Layer2"> <?php include ("nav.php"); ?> </div> you have no space after the <? Quote Link to comment Share on other sites More sharing options...
makaveli Posted December 11, 2006 Author Share Posted December 11, 2006 (edited) thanks Thomas and Don, Legends it looks to be working, i shall be going to London tomorrow with my head clear of all deadline worries i was going in circles looking at the tech help on the net, it was "too deep" so as usual TCH family can help in plain english Edited December 11, 2006 by makaveli Quote Link to comment Share on other sites More sharing options...
makaveli Posted December 11, 2006 Author Share Posted December 11, 2006 hmm.. just test uploaded it and it's killed all the images Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted December 11, 2006 Share Posted December 11, 2006 Most likely a path issue with your images. You have them "images/....gif" Put the full path in there and I bet it works. Quote Link to comment Share on other sites More sharing options...
makaveli Posted December 11, 2006 Author Share Posted December 11, 2006 (edited) so id have to assign them all to my exact web address i.e www.mysite.com/image/header.gif seems annoying since i have to put them in the test area then also put the main folder! tried http://testing.goldielookin.co.uk/images/title.gif (i.e full path) and still no joy! Edited December 11, 2006 by makaveli Quote Link to comment Share on other sites More sharing options...
TCH-Thomas Posted December 11, 2006 Share Posted December 11, 2006 See if any of the answers in this thread helps. Quote Link to comment Share on other sites More sharing options...
makaveli Posted December 11, 2006 Author Share Posted December 11, 2006 looks to be what i could be looking for, i'll have a hard read and play round with the code, if not im just going to have to go to back to SSI and log the fact PHP made me almost throw any PC devices through the window Quote Link to comment Share on other sites More sharing options...
TCH-Thomas Posted December 11, 2006 Share Posted December 11, 2006 Let us know how it goes. Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted December 11, 2006 Share Posted December 11, 2006 If your images directory is in your public_html directory then make your image links "/images/....gif". Note the leading "/" before images. Quote Link to comment Share on other sites More sharing options...
TCH-Don Posted December 11, 2006 Share Posted December 11, 2006 You are in a sub folder in a sub domain that makes referencing images in the domain root/image folder tricky. Why not copy the image folder to the sub domain/ sub folder for testing so you can continue using the path you have now. http://testing.goldielookin.co.uk/hmm/images/title.gif Quote Link to comment Share on other sites More sharing options...
makaveli Posted December 11, 2006 Author Share Posted December 11, 2006 (edited) aha don! cracked it!! thanks ever so much! it was the domain thing! goldielookin.co.uk/phpphp works. (bits of it at current dont work as i need to change the code) php is still a pain, but at least it works and after slashing the slashes... it works Edited December 11, 2006 by makaveli Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted December 11, 2006 Share Posted December 11, 2006 php is still a pain Not really, just different. Quote Link to comment Share on other sites More sharing options...
makaveli Posted December 11, 2006 Author Share Posted December 11, 2006 it's a pain when you dont really "get it" but i learn from my mistakes! Quote Link to comment Share on other sites More sharing options...
curtis Posted December 11, 2006 Share Posted December 11, 2006 The title image shows fine. <td colspan="3"> <img src="images/title.gif" width="800" height="48" border="0" alt="Tourist Information"></td> </tr> <tr> <td rowspan="2"> <img src="/images/left.gif" width="48" height="552" alt=""></td> <td> <img src="/images/body.gif" width="586" height="522" alt=""></td> <td rowspan="2"> <img src="/images/right.gif" width="166" height="552" alt=""></td> </tr> <tr> <td> <img src="/images/bottom.gif" width="586" height="30" alt=""></td> </tr> the other images (left,body,right,bottom) have a forward slash that the title image doesn't . The slash in bold. I think removing that slash will correct your problem. Quote Link to comment Share on other sites More sharing options...
makaveli Posted December 11, 2006 Author Share Posted December 11, 2006 yep i was doing that as you had typed that message Quote Link to comment Share on other sites More sharing options...
makaveli Posted December 12, 2006 Author Share Posted December 12, 2006 asides a few images i need to put in take (need some in the train station, and its hard to get them without getting told off!) (it's a travel site for a project) it's all done.. thanks ever so much to everyone that has helped in any way, shape or form! have some e-gold :) Quote Link to comment Share on other sites More sharing options...
TCH-Don Posted December 12, 2006 Share Posted December 12, 2006 Once you get used to PHP you will depend on it. It can reduce the amunt of code you need by including common parts. And its easier to make global changes. Quote Link to comment Share on other sites More sharing options...
carbonize Posted December 14, 2006 Share Posted December 14, 2006 (edited) Just remember to use single quotes around strings as this is faster. If you use double quotes PHP will scan the string looking for any variables in it. As Don says using PHP can make maintaining your site a lot easier. Every page on my site consists of three parts. The header, the content and the footer. The content only contains the include for the header, the actual HTML for that pages content and then the include for the footer. Using this method along with a CSS controlled layout means it's a lot easier to change your sites look. If you want I have some ebooks at home on PHP that I will happily send to you. Edited December 14, 2006 by carbonize 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.