Professional Web Applications Themes

Extension to Force DW to Recognize PHP in HTML files - Adobe Dreamweaver & Contribute

Hi there, I've got several sites that use PHP code blocks embedded within plain .html files. It's an apache server and I simply use AddHandler application/x-httpd-php in the .htaccess file to tell the server to p them for PHP. It works fine for these sites where we don't want to change URLs by modifying filenames. However, Dreamweaver doesn't treat these PHP code blocks as PHP (with one exception, which I'll get to). Instead, it displays the code block as plain text, without code coloring or code hints. It also doesn't provide the "Insert > PHP Objects" option from the insert ...

  1. #1

    Default Extension to Force DW to Recognize PHP in HTML files

    Hi there,

    I've got several sites that use PHP code blocks embedded within plain .html
    files. It's an apache server and I simply use AddHandler
    application/x-httpd-php in the .htaccess file to tell the server to p them
    for PHP.

    It works fine for these sites where we don't want to change URLs by modifying
    filenames.

    However, Dreamweaver doesn't treat these PHP code blocks as PHP (with one
    exception, which I'll get to). Instead, it displays the code block as plain
    text, without code coloring or code hints. It also doesn't provide the "Insert
    > PHP Objects" option from the insert menu.
    I'd like to find a way to get Dreamweaver to treat the PHP code in these files
    properly, but I haven't found an extension that could do it.

    The one exception I mentioned above is with PHP includes. When I have a PHP
    include, Dreamweaver displays it as "Server Markup" in the properties box,
    without the filename selection or edit properties you get with an actual .php
    file.

    However, the "related files" bar does correctly show the included file (I'm
    using CS4), so on some level, DW seems to know that it is a PHP code block.

    I'm hoping this is either an existing extension that I wasn't able to find
    when I searched the libray, or that it's a functionality I could enable myself
    without an extension if I'm given the right direction to look.

    Anybody have any thoughts on this?

    Thanks in advance,
    Jade

    spiderjade Guest

  2. #2

    Default Re: Extension to Force DW to Recognize PHP in HTML files

    "spiderjade" <webforumsusermacromedia.com> wrote in message
    news:gnsbfg$l7h$1forums.macromedia.com...
    > I'm hoping this is either an existing extension that I wasn't able to find
    > when I searched the libray, or that it's a functionality I could enable
    > myself
    > without an extension if I'm given the right direction to look.
    [url]http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16410&sliceId=1[/url]


    --
    ----------------------------
    Massimo Foti, web-programmer for hire
    Tools for ColdFusion, JavaScript and Dreamweaver:
    [url]http://www.massimocorner.com[/url]
    ----------------------------


    Massimo Foti Guest

  3. #3

    Default Re: Extension to Force DW to Recognize PHP in HTML files

    Hi Massimo,

    Thanks for that. I used the article's info to change the filetype association so that .htm and .html files are treated as PHP.

    That seems to do the trick, so thanks again.
    spiderjade Guest

  4. #4

    Default Re: Extension to Force DW to Recognize PHP in HTML files

    Just a quick update on this issue.

    After making that change as Massimo suggested, I thought I had solved the
    issue.

    However, once I started actually working in Dreamweaver I started running into
    "Runtime Errors" so I had tried reverting to my backed up copy of
    MMDoentTypes.xml and that stopped the Runtime Errors.

    So, I'm back where I started from.

    spiderjade Guest

  5. #5

    Default Re: Extension to Force DW to Recognize PHP in HTML files

    I had a similar problem editing 'PHP' files.
    Installed 'MAMP' (local server software).
    (Also 'MAMP PRO' is available for windoz boxes.)

    Now creating, editing, and proofing PHP files is as easy as htm/html.

    Dan H.
    ........................
    On 2/23/09 4:40 PM, in article gnv53u$8ko$1forums.macromedia.com,
    "spiderjade" <webforumsusermacromedia.com> wrote:
    > Just a quick update on this issue.
    >
    > After making that change as Massimo suggested, I thought I had solved the
    > issue.
    >
    > However, once I started actually working in Dreamweaver I started running
    > into
    > "Runtime Errors" so I had tried reverting to my backed up copy of
    > MMDoentTypes.xml and that stopped the Runtime Errors.
    >
    > So, I'm back where I started from.
    >
    dan@hoppernet.org Guest

  6. #6

    Default Re: Extension to Force DW to Recognize PHP in HTML files

    Hi Dan,

    Thanks for the reply, but I think you missed my point.

    I don't have any problem creating, editing or proofing PHP files.

    My localhost server works just fine for viewing them and Dreamweaver obviously
    works properly with them.

    My problem is with .html files, not .php files. I need dreamweaver to
    recognize PHP code when it is embedded in .html files.

    Thanks anyway.

    spiderjade Guest

  7. #7

    Default Re: Extension to Force DW to Recognize PHP in HTML files

    Instead of naming your file with a .html extension, name it with a .php
    extension and Dreamweaver will now apply the color you are looking for. It
    will have to have the .php extension to be processed by your php server anyway.

    Julian Spite Guest

  8. #8

    Default Re: Extension to Force DW to Recognize PHP in HTML files

    Hi Julian,

    Thanks for the post, but I guess you didn't read my original post.

    It IS possible to p php code without the .php extension. If you're on an
    apache server, you just add a handler in the .htaccess file.

    And changing the filenames from .html to .php is an obvious solution that I
    already said I don't want to do (for a variety of reasons).

    So, as an update, I've been going back and forth with Dreamweaver support on
    this issue and they're still trying to help. I'll keep you posted if and when a
    solution comes along.

    Jade

    spiderjade Guest

  9. #9

    Default Re: Extension to Force DW to Recognize PHP in HTML files

    Hello,
    Not sure if this works but you can try editing this file :
    Adobe\YourDreamweaverFolder\configuration\Doent Types
    \MMDoentTypes.xml

    Look for doenttype id="PHP_MySQL"
    Just update the winfileextension and/or macfileextension with your
    extensions.

    fred
    [url]http://www.tzav.fr[/url]
    FredTzav Guest

Similar Threads

  1. Windows doesnt recognize flash (.swf) files ??
    By AndyManchesta in forum Macromedia Flash Player
    Replies: 6
    Last Post: February 27th, 10:03 PM
  2. DW MX Doesn't Recognize FW MX 2004 HTML Files For Import
    By ockhamsrazor webforumsuser@macromedia.com in forum Macromedia Fireworks
    Replies: 4
    Last Post: September 11th, 10:31 PM
  3. Replies: 4
    Last Post: September 11th, 02:34 AM
  4. can i force a shockwave file to load before html?
    By wutodd webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 2
    Last Post: July 16th, 02:51 AM
  5. Way To Have FW Open & Still Recognize Newly Added Files?
    By Pat in forum Macromedia Fireworks
    Replies: 6
    Last Post: July 7th, 09:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139