VagabondKites Posted June 3, 2009 Share Posted June 3, 2009 Hello Experts! Here is my problem: I created a header.php file that I'm going to "php require" in many pages of my website. I am expecting to often edit this header in the future to replace some pictures, add navigation button etc...) and I don't want to spend a lot of time to edit every single page and transfer the whole site at every modification!! Until this point, everything is working great when I preview and on my hosting server... N.B.: I'm using DreamWeaver CS3. The problem I have is that when I want to use the Design Mode in DW to create a new pages that is using the "require", instead of displaying the header.php and thena blank page that I can edit, it displays only the header.php and doesn't let me work on the rest of the page. I tried to pud the <?php require fonction on the top of my HTML code, between the Head and Body section, at the beginning of the Body and that doesn't make any difference! The "bypass" i'm doing right now is to put my require command in "comments /* & */ to prevent DW from reading the require function until my webpage is finished and then I remove the "comment". Is there any way that I could avoid doing this bypass and still being able to design my page in Design Mode? I would like to be able to preview my header in Design Mode so I can visually align the page elements with the header elements... Maxime Quote Link to comment https://forums.phpfreaks.com/topic/160793-php-require-function-creates-display-problem-in-dreamweaver-cs3-design-mode/ Share on other sites More sharing options...
sniperscope Posted June 3, 2009 Share Posted June 3, 2009 i think you are using DreamWeaver's tamplate page. Quote Link to comment https://forums.phpfreaks.com/topic/160793-php-require-function-creates-display-problem-in-dreamweaver-cs3-design-mode/#findComment-848630 Share on other sites More sharing options...
wildteen88 Posted June 3, 2009 Share Posted June 3, 2009 Dreamweaver wont be able to understand PHP so you get virtually no output when you go to Design View just a bunch of PHP images representing where you PHP code is. The best thing to do is to setup a Site Definition to your live/development server. You should then manually modify your code via Code View. To preview your changes you should swap to your web browser and navigate to your live/development site. This is only possible way. Quote Link to comment https://forums.phpfreaks.com/topic/160793-php-require-function-creates-display-problem-in-dreamweaver-cs3-design-mode/#findComment-848703 Share on other sites More sharing options...
VagabondKites Posted June 5, 2009 Author Share Posted June 5, 2009 Thank you WildTeen88 for your answer. However, this is not exactly the answer I was expecting... In fact, Dreamweaver seems to understand and interpret PHP as the header.php file appears in design mode of the pages where I use the Include function. The Problem is that everything else than the include (header.pho) will NOT appear ?!?! Anyway, this is what I'm doing right now. I have wampserver installed and I use the Dreamweaver F12 function (preview with browser) very often ;-)!! Because I'm a beginner, I prefer building in design mode than in code mode... This is why I was hoping to visualize the include + the actual page directly into Dreamweaver to ease the creation of my pages... SniperScope, I start every pages with blank php pages?! Why are you saying that?! What can be the link with display problem when using php code and templates?? Maxime Quote Link to comment https://forums.phpfreaks.com/topic/160793-php-require-function-creates-display-problem-in-dreamweaver-cs3-design-mode/#findComment-850103 Share on other sites More sharing options...
fazlionline Posted June 23, 2009 Share Posted June 23, 2009 Ok I got the solution same in REQUIRE or INCLUDE Just replace youre your code < ?php include("includes/header.php); ?> With this one < ?php @include("includes/header.php); ?> Did you have the difference, if not, the @ symbol in added before the word include or 'require'! Hope this will work Quote Link to comment https://forums.phpfreaks.com/topic/160793-php-require-function-creates-display-problem-in-dreamweaver-cs3-design-mode/#findComment-861881 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.