Skip to main content
New Participant
November 20, 2012
Question

Convert DW html pages to PHP in Dreamweaver CS4

  • November 20, 2012
  • 2 replies
  • 6416 views

Created web pages in DWCS4 in html but discovered because I need some form pages to interact with MySQL that I should have created pages using DW PHP format. Is there a simple way to convert all html pages to php using dreamweaver CS4? OS is Win XP. Have access to hosting company with MySQL, PHP,PHPAdmin.

This topic has been closed for replies.

2 replies

Nancy OShea
Community Expert
Community Expert
November 21, 2012

File > SaveAs >filename.php. 

Don't forget to delete filename.html pages from your local and remote sites.

Nancy O.

Nancy O'Shea— Product User & Community Expert
Jon Fritz
Community Expert
Community Expert
November 21, 2012

I would recommend against Nancy's suggestion here (and it's REALLY weird to see myself typing that).

I say it only because you are working within an existing site that likely already has links going to the .html file you are changing.

If you do a Save As and create a new .php file based on the still existing .html file, you will need to manually change the links on the pages that are currently pointing to the that .html file so they will point to the new .php file. You would need to either open the pages individually and fix the links, or use DW's Find & Replace feature and do a site-wide correction.

However, if you change the file extension from within the Files tab instead, DW will  update any pages that link to it automatically.

Nancy OShea
Community Expert
Community Expert
November 21, 2012

Good call, Jon.

To keep links intact, using the Files panel & F2 to rename each one is safer. 

Nancy O.

Nancy O'Shea— Product User & Community Expert
Jon Fritz
Community Expert
Community Expert
November 20, 2012

All you have to do is change the .html extension to .php from within the Files tab for those pages with actual php code in them.

That's it.