eddie barzoon Posted October 24, 2006 Share Posted October 24, 2006 My professor wants us to make our html pages into php pages with the use of "include" in our code.My web space consists of:Main folder: /public_htmlThree sub folders: personal, exercises, imagesThe main folder has index.php, styles1.shtml, header1.shtml, header2.shtml, footer1.shtml, footer2.shtmlThe personal folder has another index.phpThe exercises have class exercises in itThe images has image files in itThe files that he wants us to use in the includes are the styles, footers, and headers. I don't have a problem using them on in the index code, it's just < ? php include("header1.shtml"); ? >But the files I need to use these includes are in the exercises folder and not the main folder. How do I write an include to use these? Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 24, 2006 Share Posted October 24, 2006 It's just a path tot he files, just like a link in HTML:< ? php include("exercises/header1.shtml"); ? > Quote Link to comment Share on other sites More sharing options...
Cagecrawler Posted October 24, 2006 Share Posted October 24, 2006 Actually, to go from exercises to the main folder you'll want:<?php include("../header1.shtml"); ?> Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 24, 2006 Share Posted October 24, 2006 Ah, I misread that. Thanks for picking up my fumble. 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.