Jump to content
wampthing

Php Includes & Dreamweavermx

Recommended Posts

I have been messing around with PHP includes. I am just starting to learn, with some success. Specifically I am trying to include things like the menu bar at the top, etc.

I have uploaded my files and gotten it to look right on the web, but the Design view (Not the PREVIEW in explorer) seems to not show anything under the PHP Include. It will show a place for the include, but everything under it is missing. Anyone have any Ideas? DO I just need to learn to do it all by hand and not mess with Dreamweaver? Please say no.

What I am trying to do is get away from using frames, but make the site updating easier.

Share this post


Link to post
Share on other sites

I use DreamWeaver (DW) and PHP includes and the unfortunate thing is that DW can't interpret the PHP commands so it sticks in the PHP placeholder. You could look at the whole testing server thing in DW but sometimes it's just easier to upload it and view the page to see if it comes out the way you want.

 

Another thing you can do is to put a web server on your PC that understands PHP and view the pages locally. One server that has been recommended in this forum before is the Abyss web server. It was free but I'm not sure about the current version. Anyway, you can set up your PC as a web server and have it "serve up" the pages, interpreting PHP as it goes. You can do a search on the forum for Abyss and find more info.

Share this post


Link to post
Share on other sites

The Abyss web server is very handy (aprelium.com) for this but pay special attention to the docs for setting up your file hierarchy.

Share this post


Link to post
Share on other sites

Is there an editor that you would recommend that ALSO interprets php includes?

 

thanks.

Share this post


Link to post
Share on other sites

I think to see the includes on your computer you will need to install apache web server with php

 

For php editors here is a roundup of editors with reviews.

Share this post


Link to post
Share on other sites
I think to see the includes on your computer you will need to install apache web server with php

 

For php editors here is a roundup of editors with reviews.

 

So, as Don mentioned, regardless of editor (whether it is Dreamweaver or PHP Designer 2005) I would still need to install php and Apache Web Server on my computer, right?

 

Thank you.

Share this post


Link to post
Share on other sites

In Dreamweaver MX and newer, it WILL show any HTML in the include file, but of course dynamic PHP stuff won't show up. Includes are one of the very few PHP things that Dreamweaver does actually read and do something with, at least to show any HTML stuff in the include.

 

I use this feature to create consistent headers, footers, or navigation bars -- all the HTML for these is in a seperate file which is included via PHP into the actual pages; that way I only have to edit one file to update the navigation bar. I prefer this to using Dreamweaver templates, and the navigation bar will show up in design view on Dreamweaver (although you can't edit it without opening up the actual include file).

Share this post


Link to post
Share on other sites
In Dreamweaver MX and newer, it WILL show any HTML in the include file, but of course dynamic PHP stuff won't show up.

I use Dreamweaver MX to create dynamic PHP pages and can view them when using Live View.

mxlive.jpg

Share this post


Link to post
Share on other sites

Point taken. I'll have to check out that tutorial.

Share this post


Link to post
Share on other sites

Rather than installing apache, etc., you can also download for a 30 day trial, and then purchase for about $20 SOKKIT. This gives you space on your local computer to run PHP code to test prior to uploading to your web server.

Share this post


Link to post
Share on other sites
Rather than installing apache, etc., you can also download for a 30 day trial, and then purchase for about $20 SOKKIT.  This gives you space on your local computer to run PHP code to test prior to uploading to your web server.

Jim, this is the coolest thing I've seen all day. Took me less than 20 minutes to download, install, and get my site up and running on my local machine. Thanks for the tip.

 

-Tim

Share this post


Link to post
Share on other sites
you can also download for a 30 day trial, and then purchase for about $20 SOKKIT.  This gives you space on your local computer to run PHP code to test prior to uploading to your web server.

 

 

How different is this from Live View that Dick mentioned earlier?

Share this post


Link to post
Share on other sites
you can also download for a 30 day trial, and then purchase for about $20 SOKKIT.  This gives you space on your local computer to run PHP code to test prior to uploading to your web server.

 

 

How different is this from Live View that Dick mentioned earlier?

 

 

I don't use Dreamweaver as my primary tool... so I could not answer that question for you in comparisoin.

 

SOKKIT basicly creates a PHP enabled web server on your local computer, where you can then place your PHP pages and run as if they were on a web server, per se.

Share this post


Link to post
Share on other sites

Hello... jnull i registered to here only to ask about this program, i know it's abit late not sure if you will reply me or even using this forum, i'm confused the same as the author of this topic, looking for a programa to make php easy and this sokkit sounded brilliant could help me, you or somebody?

Share this post


Link to post
Share on other sites

@sweetlati - It does look like Sokkit is no longer available - http://www.sokkit.net/ - unfortunate, because it was a well working resource for PHP that didn't require a web server. I would recommend, if you're wanting to learn PHP - that you get a domain name, setup a hosting account here with TCH, then purchase this book in paper or digital - and start coding through the examples in it. You'll be PHPing in no time.

 

Book: http://www.sitepoint.com/books/phpmysql5/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×