简体   繁体   English

使用 SQL 将 HTML 表单数据输入到数据库中?

[英]Entering HTML form data to database using SQL?

是否可以在不使用 PHP 脚本的情况下使用SQL 将 HTML 表单数据输入到数据库中?

It is possible to do it without using a PHP script, but not without using some kind of server-sided script.可能做到这一点,而无需使用PHP脚本,但如果不使用某些类型的服务器片面的脚本。 if your database is stored on a server.如果您的数据库存储在服务器上。 It doesn't have to be PHP, it just needs to be something that can take your form data and pass it to the database.它不必是 PHP,它只需要是可以获取表单数据并将其传递给数据库的东西。 Or if your database is stored on your client PC, you could do it there I guess.或者,如果您的数据库存储在您的客户端 PC 上,我想您可以在那里进行。

No you can't (so far my knowledge goes, i never heard of it anyway) plus you might get into big security problems as you have no control of injection attaks.不,你不能(到目前为止,我的知识是,我从来没有听说过)而且你可能会遇到很大的安全问题,因为你无法控制注入攻击。 Always use a server language of any kind (php, asp, python, java or similar) and validate all data before it gets pushed to the database.始终使用任何类型的服务器语言(php、asp、python、java 或类似语言)并在将所有数据推送到数据库之前对其进行验证。 anyway you can pull data directly with html/xml (old fashined way) but still i think of leaks!无论如何,您可以直接使用 html/xml 提取数据(旧方式),但我仍然想到泄漏! my advice to begin with would be a framework what does the job for you in a secure/ save way like laravel, symfony, yii2 or doctrine.我的建议首先是一个框架,它以安全/保存的方式为您做什么,如 laravel、symfony、yii2 或学说。 there is very much example code and your learning curve for php might be easier thank plain php.有很多示例代码,你的 php 学习曲线可能更容易感谢普通的 php。

here's the link to the old fashion way of getting data without php but not sending it to the db directly: https://smallbusiness.chron.com/insert-form-mysql-51070.html这是在没有 php 的情况下获取数据但不直接将其发送到数据库的旧时尚方式的链接: https : //smallbusiness.chron.com/insert-form-mysql-51070.html

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

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