Benzsupra Posted January 19, 2009 Share Posted January 19, 2009 Hi, I'm building a site at the moment (my first one) and i'm having a problem getting my index page to read the php files i've created to include the top bar, right & left columns and the footer. From what i can see the code is correct but i just can't get it to show when i publish it. This is one of the include commands i have put in: include('sttb/shared/top.php'); ?> And this is the PHP code: images/topbar.gif I'm using dreamweaver cs3 for this. If anyone can see a problem with this code please help me correct it because it's driving me crazy!!!!!!! Thanks, Ben Quote Link to comment Share on other sites More sharing options...
SupraShaun Posted January 19, 2009 Share Posted January 19, 2009 Is your server configured to use php short tags? For example rather than <?php Quote Link to comment Share on other sites More sharing options...
Benzsupra Posted January 19, 2009 Author Share Posted January 19, 2009 It's not actually our server, we're on my friends server at the mo so i'm not sure but i just changed it to: <?php include('sttb/shared/top.php'); ?> I'm assuming that's what you mean but it made no difference... Quote Link to comment Share on other sites More sharing options...
Benzsupra Posted January 19, 2009 Author Share Posted January 19, 2009 Also on the design view window of dreamweaver the main content window is outside the main container window. Would this be affect it at all? I can't seem to get the main content window to do away with the padding.... Quote Link to comment Share on other sites More sharing options...
SupraShaun Posted January 19, 2009 Share Posted January 19, 2009 Yep thats what i mean. In your directory structure is the file you are working on- for example index.php at the same level as sttb? Sorry mate i cant help with the Dreamweaver stuff as i hand code Quote Link to comment Share on other sites More sharing options...
SupraShaun Posted January 19, 2009 Share Posted January 19, 2009 Try using <?php require_once('sttb/shared/top.php');?> as this will give you an error message rather than continuing if the file cannot be found (like include does) Quote Link to comment Share on other sites More sharing options...
Benzsupra Posted January 19, 2009 Author Share Posted January 19, 2009 I don't have an index.php file just a index.html, would that be why? Quote Link to comment Share on other sites More sharing options...
Benzsupra Posted January 19, 2009 Author Share Posted January 19, 2009 Oh and hat's off if you hand code! I'm having trouble using the easier method! Quote Link to comment Share on other sites More sharing options...
SupraShaun Posted January 19, 2009 Share Posted January 19, 2009 That could be why, change it to .php and try using what i just said above ^^ Quote Link to comment Share on other sites More sharing options...
Benzsupra Posted January 19, 2009 Author Share Posted January 19, 2009 Just changed it to a .php and got some errors to deal with. At least i got something to go on though! It was just blank before. I'll work with this for a min and see what i can solve. Have a look at http://turbulentsoundscape.com/sttb/ if you get a second. Would it be a server problem maybe? I'll crack on and see if i can change some things. Thanks for the help mate. Quote Link to comment Share on other sites More sharing options...
SupraShaun Posted January 19, 2009 Share Posted January 19, 2009 Take sttb/ out so its just <?php require_once('shared/top.php');?>, as by the looks of it your index.php file is within "sttb" - so you dont need it in the path Quote Link to comment Share on other sites More sharing options...
Benzsupra Posted January 19, 2009 Author Share Posted January 19, 2009 That worked!!!! Thanks loads mate, i been on that for 2 days LOL Quote Link to comment Share on other sites More sharing options...
SupraShaun Posted January 19, 2009 Share Posted January 19, 2009 No probs mate 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.
Note: Your post will require moderator approval before it will be visible.