防止 Dreamweaver 在保存时执行 PHP 脚本
我正在运行 Dreamweaver CS5。 由于某种原因,当我“保存”PHP 脚本时,它会尝试在服务器上运行它。这导致大量错误插入数据库,我想禁用此选项,但我不知道如何禁用。
干杯
I am running Dreamweaver CS5.
For some reason, when I 'save' my PHP script it tries to run it on the server. This is causing a lot of erroneous inserts into the database and I would like to disable this option but I don't know how.
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许是“Découvrir les fichiers à Association dynamique”(发现文件动态关联?),确保它处于“Manuellement”(手动)或“Désactivé”(关闭)状态。
Maybe it's "Découvrir les fichiers à association dynamique" (Discover files dynamic association ?), ensure it is on "Manuellement" (manually) or "Désactivé" (off).
您使用的是 Dreamweaver 的实时视图吗?如果是这样,那么就显示页面,该页面是通过服务器运行的(至少在PHP页面中,我相信html页面是在本地运行的)。因此,如果您的页面确实在加载时插入,那么当页面在实时视图中刷新时,它会在服务器上再次执行,因此会执行插入。
当然,如何解决这个问题取决于您的特定代码的作用。您可以停止使用实时视图,或者添加一个“$designMode”标志,以防止在测试/更新页面时添加插入内容。但是,如果您忘记将标志更改回实时设置,这可能会成为问题。
但是您也可以检查页面的逻辑,并确保仅在用户操作上执行插入,例如将表单提交到同一页面(或从另一个页面),而不是在您正在工作的页面的页面加载时执行插入在。
如果您没有在页面加载时进行插入,那么您需要共享一些代码以尝试缩小问题范围。
Are you using Dreamweaver's Live View? If so, then do display the page, the page is run through the server (at least in PHP pages, html pages are run locally I believe). So if your page does inserts on load, then when the page refreshes in Live View, it is executed again on the server, therefore inserts are performed.
How to get around this of course this depends on what your specific code does. You could stop using Live View, or perhaps add a "$designMode" flag that prevents inserts being added when you're testing/updating the page. However this could be an issue if you forget to change the flag back to the live setting.
But you could also check the logic of the page and make sure that you only do the inserts on a user action such as submitting a form to the same page (or from another page), not on page load of the page you're working on.
If you're not doing inserts on page load, then you'll need to share some code in order to try to narrow down the issue.