To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Tools > Dreamweaver

Dreamweaver In need of help with Dreamweaver?

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-28-2003, 12:14 AM   #1
gmdavis
Member
 
Join Date: Dec 2002
Location: Rochester, NY
Posts: 45
Dreamweaver and php?

I hate asking such a basic question but...

I have been coding my PHP site in text editors exclusively for several months. Most of the pages are just a bunch of includes based on an included html framework.

I finally got Dreamweaver and imported my entire site. However, in dreamweaver, every page shows only the code, no WYSIWYG preview available just a blank window.

What good is this? Basically I have a much more expensive text editor.

Is there some setting I need to change or maybe Dreamweaver lets you use PHP but only if you follow certain rules. What's the trick? The documentation doesn't say much about PHP.

BTW, if this has anything to do with it, my files typically have an .html extension, not .php. Thsi works fine on my server as the Apache config files have been modified to parse html files for PHP. I'm thinking maybe Dreamweaver doesn't expect this.
__________________
hear it first at homeschoolbuzz.com
gmdavis is offline   Reply With Quote
Old 08-28-2003, 11:21 AM   #2
stolzyboy
Super Moderator
 
stolzyboy's Avatar
 
Join Date: Sep 2002
Location: Fargo, North Dakota
Posts: 6,647
yeah, that could likely be your problem, a simple test would be to change one of the pages to .php and give it a whirl
__________________

http://www.codesight.net - Custom Web Development, Web Hosting, Web Consulting
stolzyboy is offline   Reply With Quote
Old 08-28-2003, 05:50 PM   #3
mzanimephp
genki ni shitemashitayo
 
mzanimephp's Avatar
 
Join Date: Dec 2002
Location: California
Posts: 274
Do you have Dreamweaver MX? If your using version 4 then you might as well throw in the towel. Ver.4 has vertially no dynamic support compaired ot DWMX.

Aso, If you have your include setup to echo every single HTML line then they won't display included in wysiwyg view. But if the contents of the includes are entirely HTML then they should be visible in wysiwyg.
__________________
Scripting PHP, one line at a time | My web site
mzanimephp is offline   Reply With Quote
Old 08-28-2003, 11:17 PM   #4
gmdavis
Member
 
Join Date: Dec 2002
Location: Rochester, NY
Posts: 45
YesI do have Dreamweaver MX. Just got it so it's the latest.

Not every html line of my includes is echoed but a fair amount. I will continue to experiment when I have a minute.
__________________
hear it first at homeschoolbuzz.com
gmdavis is offline   Reply With Quote
Old 08-29-2003, 01:37 AM   #5
mzanimephp
genki ni shitemashitayo
 
mzanimephp's Avatar
 
Join Date: Dec 2002
Location: California
Posts: 274
Well thats the reason why Dreamweaver doesn't display them in wysiwyg view.

Dreamweaver won't display:

PHP Code:
echo "<head>";
echo
"<title>Untitled</title>";
echo
"</head>";
But it will display plain code inside a PHP include:

PHP Code:
<head>
<
title>Untitled</title>
</
head>
So you should try to display as much plain HTML as possible. And too this helps PHP, because PHP skips HTML code when parsing But if you go <?php echo HTML CODE ?> then it makes it parse extra PHP unecessarily, when you can simple leave it as regular HTML code..
__________________
Scripting PHP, one line at a time | My web site
mzanimephp is offline   Reply With Quote
Old 08-30-2003, 09:34 AM   #6
futureshock
Junior Member
 
Join Date: Jun 2002
Posts: 6
Very Important!

We must remember that PHP is produced on the server side and not on the client/browser end, and MX displays the layout view with a dumbed down browser type setup.

To be able to fully view what your PHP code will do and look like, you must set up MX to also work with a 'test server'.

If you do not have the 'test server' defined then you will not be able to view any dynamic content produced by PHP.

Basicly what you do is, define your test server (nothing more then redefining your site connection parameters under a different section). Then when you want to view what your PHP 'actually' looks like, you hit F12 (preview in browser) and MX will send the page to where you defined your test server and then display it in the browser after being processed.

Also as mz said above, how you implement your html/php code with each other helps.

For instance when I create dynamic tables I mix both styles of output.

PHP Code:
<html>
<body>
<table>
<?
while($row = mysql_fetch_array($results))
   {
     
?>
      <tr>
        <td>col1</td>
        <td>col2</td>
        <td>col3</td>
      </tr>
     <?
   
}
?>
</table>
</body>
</html>
This will allow you to view a single row of a table in 'layout' view resizing or CSS editing.

I personally don't use the preview in browser feature, I usually keep my site open and then when I have edited a page, I upload it and then view it from the net.

I hope this helps.
I code all my pages exclusivley using MX and most pages are extremely PHP laden so I have learned a few tips and tricks.

If you have any questions you can contact me directly at: scotyj1@cox.net

Last edited by futureshock; 08-30-2003 at 09:45 AM.
futureshock is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 06:59 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.