dreamweaver <?php & ?> special characters must be escaped error

五迷三道 提交于 2020-06-29 13:17:20

问题


I've hunted around everywhere for this error fix, but no luck.

Using Dreamweaver, when i put the PHP code bracketing into an html file such as <?php echo 'Why does it not work?'; ?> or something similar, I always get an error "Special characters must be escaped". I can't stand it anymore!

Any help would be soooo much appreciated. I've tried to change the code type at the bottom so it recognises it as PHP and doesn't give me grief about the brackets, but nothing.

I've modified the .htaccess file on the server so I've got no problems running php code in a html file.


回答1:


  • Go to Edit -> Preferences
  • in left panel highlight linting
  • then in edit rule set highlight html, click edit and apply changes, scroll down to where it says "spec-char-escape": true, and change it to false, edit your page
  • click save

You should no longer see errors




回答2:


I thought I'd put the answer here in case anyone else has a similar problem. The validation I was talking about is called "linting" in DW. I edited the linting HTML file from inside DW: Edit > Preferences > Linting > Select code type then Edit & Apply changes. In my case I set escape special characters to false in the file. Voila!

Here's the linting specs: https://github.com/yaniswang/HTMLHint/wiki/Rules



来源:https://stackoverflow.com/questions/45401229/dreamweaver-php-special-characters-must-be-escaped-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!