HighDots Forums  

PHP include in DW CS3

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss PHP include in DW CS3 in the Macromedia Dreamweaver forum.

Reply
 
Thread Tools Display Modes
  #1  
Old   
anat123quick09
 
Posts: n/a

Default PHP include in DW CS3 - 01-28-2009 , 07:15 AM






If I put a tag like this <?php include ('menu.php'); ?> in my file, I can only
preview it after putting the file on a server. How can I preview it in my local
computer without uploading the files to a server?
Thanks





Reply With Quote
  #2  
Old   
malcster2
 
Posts: n/a

Default Re: PHP include in DW CS3 - 01-28-2009 , 07:41 AM






you can set up a test server on your machine, but as php is a server side
language, thats where it is read from.

if the php include only includes echoed html, then you can put the html in the
rellevant position on the html page first, test it, and then transfer to an
include afterwards.


Reply With Quote
  #3  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: PHP include in DW CS3 - 01-28-2009 , 07:51 AM



Make sure you have enabled the display of includes in your preferences, and
that you have named the page with a PHP filename extension.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"anat123quick09" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
If I put a tag like this <?php include ('menu.php'); ?> in my file, I can
only
preview it after putting the file on a server. How can I preview it in my
local
computer without uploading the files to a server?
Thanks




Reply With Quote
  #4  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: PHP include in DW CS3 - 01-28-2009 , 07:57 AM



I think this is off the mark, malcolm.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"malcster2" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
you can set up a test server on your machine, but as php is a server side
language, thats where it is read from.

if the php include only includes echoed html, then you can put the html in
the
rellevant position on the html page first, test it, and then transfer to
an
include afterwards.



Reply With Quote
  #5  
Old   
yehu67
 
Posts: n/a

Default Re: PHP include in DW CS3 - 01-28-2009 , 07:58 AM



I want to see the hole page with the includes together in the same html page, not in separate html files. The content of the php files is only html

Reply With Quote
  #6  
Old   
malcster2
 
Posts: n/a

Default Re: PHP include in DW CS3 - 01-28-2009 , 08:02 AM



to test out the include content, put the html in the page, and then transfer to
the include when you know it works....php is a SERVER side language. it's read
from a server.

as i say, if you don't want to test live, set up an apache test server on your
computer.


Reply With Quote
  #7  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: PHP include in DW CS3 - 01-28-2009 , 08:32 AM



Quote:
I want to see the hole page with the includes together
You will be able to do this.

Quote:
in the same html page
If you are using PHP includes, the page CONTAINING THE INCLUDES much be
named with a PHP file extension.

Quote:
The content of the php files is only html
That makes no difference.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"yehu67" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
I want to see the hole page with the includes together in the same html
page, not in separate html files. The content of the php files is only html


Reply With Quote
  #8  
Old   
Osgood
 
Posts: n/a

Default Re: PHP include in DW CS3 - 01-28-2009 , 10:15 AM



yehu67 wrote:
Quote:
I want to see the hole page with the includes together in the same html page, not in separate html files. The content of the php files is only html

Why are you using php?

Sounds like you could do this by using a 'virtual' include


<!--#include virtual="test.html" -->


If you do make sure that the page that you are bringing the file into
has a .shtml extention

It will work locally and will work once you upload to your server, most
support .shtml files


Reply With Quote
  #9  
Old   
Osgood
 
Posts: n/a

Default Re: PHP include in DW CS3 - 01-28-2009 , 10:18 AM



Osgood wrote:

Quote:
It will work locally and will work once you upload to your server, most
support .shtml files
Just to clarify what I mean by locally...you will see the file in
Dreamweaver..... however you wont see it in a local browser.


Reply With Quote
  #10  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: PHP include in DW CS3 - 01-28-2009 , 11:00 AM






Not if the page has a *.php extension. And your syntax is wrong anyhow.

<!--#include virtual="/test.html" -->

would be correct.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Osgood" <notavailable (AT) thisaddress (DOT) com> wrote

Quote:
yehu67 wrote:
I want to see the hole page with the includes together in the same html
page, not in separate html files. The content of the php files is only
html


Why are you using php?

Sounds like you could do this by using a 'virtual' include


!--#include virtual="test.html" --


If you do make sure that the page that you are bringing the file into has
a .shtml extention

It will work locally and will work once you upload to your server, most
support .shtml files


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.