简体   繁体   中英

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). The app currently routes to quite a few HTML pages. A few of those HTML pages are forms that post to PHP files where the data is submitted to a db.

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. 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.

Is this goal even achievable? Should the PHP document be translated to a different language?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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