How php processes the data submitted by forms is safe. What processing is required for the form data submitted by users to prevent js and SQL injection, prevent repeated submission and illegal submission to filter out the submitted illegal data. please have the complete code. thank you ., After reading "PHP and MYSQLWEB development", you can systematically understand how php processes the data submitted by forms. this is safe.
What processing is required for the form data submitted by the user to prevent js and SQL injection and prevent repeated and illegal submission?
How can I filter out the submitted illegal data? I hope the complete code is available. thank you.
------ Solution --------------------
Read "PHP and mysql web development" and you will be able to master the system.
JS anti-injection: htmlspecialchars
SQL Injection Prevention: mysql_real_escape, addslashes
Illegal data filtering: you must check your own coding rules. if you want to check the rules, write your own code, use regular expressions, trim, isset, empty, and so on.
Prevent unauthorized submission: self-built coding. The order is isset, trim, empty, and other verifications.
Repeated submission: generate a unique ticket in the SESSION, add the ticket to the hidden of the form, submit the form, and verify that it is consistent.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.