kwstephenchan Posted February 27, 2008 Share Posted February 27, 2008 Hello all, It sounds stupid, but when I test the following php code using Dreamweaver (F12), it returns exactly the same code. But if it is a htm file, F12 returns what I want. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>無標題文件</title> </head> this is a php page <?php this is a message enclosed in php tags ?> <body> </body> </html> And this is what I get using Dreamweaver F12 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>無標題文件</title> </head> this is a php page <?php this is a message enclosed in php tags ?> <body> </body> </html> Is there some setting I missed in PHP or in Dreamweaver?? Please help! Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/ Share on other sites More sharing options...
haku Posted February 27, 2008 Share Posted February 27, 2008 When you use F12 in dreamweaver, it just opens the file as is. But PHP files need to pass through a server that parses the php code. If you want to test a php file locally, you need to set up a server on your computer, then set up dreamweaver to open the file through that server. HTM files dont need to be parsed by a server, which is why you don't have this problem with them. Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/#findComment-477824 Share on other sites More sharing options...
kranthi117 Posted February 27, 2008 Share Posted February 27, 2008 u must a server for the php files to work... but after setting up the server u can use http://www.mpsoftware.dk/phpdesigner.php to preview the php file quickly Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/#findComment-477827 Share on other sites More sharing options...
Ads Posted February 27, 2008 Share Posted February 27, 2008 Download a A Install of a Server onto Your Computer I use this ones, Seems to work for me http://www.wampserver.com/en/ Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/#findComment-477846 Share on other sites More sharing options...
kwstephenchan Posted February 27, 2008 Author Share Posted February 27, 2008 I used to have a site set up and it works fine without such server as mentioned. But after I re-installed Apache, PHP, and MySql again, I got this problem. I suspected that there may be something that I should do either in Apache or PHP but haven't but I do not know where and what. Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/#findComment-477847 Share on other sites More sharing options...
haku Posted February 27, 2008 Share Posted February 27, 2008 When you install a server onto your computer, a folder will be designated as the base folder for files. Maybe its my documents/root_folder/ or something like that. You save your files in root_folder, then you open them using the address: localhost/filename.php Make sure that your server is running when you do this. Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/#findComment-477870 Share on other sites More sharing options...
Ads Posted February 27, 2008 Share Posted February 27, 2008 I used to have a site set up and it works fine without such server as mentioned. But after I re-installed Apache, PHP, and MySql again, I got this problem. I suspected that there may be something that I should do either in Apache or PHP but haven't but I do not know where and what. Apache is the Server. WAMP, Installs PHP, APACHE, MYSQL. All in one installer it is Just easier. And there root Folder is 'www' Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/#findComment-477872 Share on other sites More sharing options...
kwstephenchan Posted February 27, 2008 Author Share Posted February 27, 2008 My Dreamweaver version is MX2004, suspect that MX2004 is not capable to handle PHP5, does anyone know. Do I need Dreamweaver CS3 to handle PHP5 programs?? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/#findComment-478158 Share on other sites More sharing options...
wildteen88 Posted February 27, 2008 Share Posted February 27, 2008 No. DW 2004 can handle PHP just fine (regardless of PHP version). Have you setup a site definition in DW? You must tell DW a server is available for parsing .php files otherwise you'll get the output you are getting. To setup a site definition in DW to go to Site > New or Site > Manage Sites to manage an existing site definition, click the Advanced tab for configuration. Here is a Tutorial for setting up a Site definition in MX 2004 Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/#findComment-478349 Share on other sites More sharing options...
kwstephenchan Posted February 28, 2008 Author Share Posted February 28, 2008 Bingo!, it works! Thanks a million! Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/#findComment-478866 Share on other sites More sharing options...
OriginalBoy Posted March 4, 2008 Share Posted March 4, 2008 wiked you got it working Quote Link to comment https://forums.phpfreaks.com/topic/93289-dreamweaver-and-php/#findComment-482959 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.