简体   繁体   English

我可以使用 PHP 在 Python 应用程序中提交动态 HTML 表单吗?

[英]Can I use PHP to submit a dynamic HTML form in a Python app?

I have a Python web app that uses Flask and Django (among other things).我有一个 Python web 应用程序,它使用 Flask 和 ZEF0F93C83E374876A61DAongam0D4D1 (其他东西)。 The app currently routes to quite a few HTML pages.该应用程序当前路由到相当多的 HTML 页面。 A few of those HTML pages are forms that post to PHP files where the data is submitted to a db.其中一些 HTML 页面是 forms ,它们发布到 PHP 文件,其中数据提交到数据库。

When launching with VSCode, all python and HTML files work great but the PHP file doesn't execute and obviously doesn't submit the data to the db.使用 VSCode 启动时,所有 python 和 HTML 文件都运行良好,但 PHP 文件不执行并且显然不将数据提交到数据库。 Conversely, when running the HTML/PHP files directly in Chrome, the data is submitted but the HTML form is no longer dynamic and the templates aren't successfully extended to the HTML file.相反,当直接在 Chrome 中运行 HTML/PHP 文件时,数据已提交,但 HTML 表单不再是动态的,并且模板未成功扩展到 HTML 文件。

Is this goal even achievable?这个目标甚至可以实现吗? Should the PHP document be translated to a different language? PHP 文档是否应该翻译成不同的语言?

You've got two questions here- is it doable, and should you do it.你在这里有两个问题——它是否可行,你应该这样做。 The answer to the first is yes, it absolutely is doable- but the answer to the second is that you should not do it as it will be a maintenance nightmare and will introduce complexities into the system that you're probably going to want to avoid.第一个的答案是肯定的,它绝对是可行的——但第二个的答案是你不应该这样做,因为这将是一场维护噩梦,并且会给系统带来你可能想要避免的复杂性.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM