This article mainly introduces the PHP automatic completion of the form of two methods, the first retrieval from the database after the completion of the second type of mailbox, such as pure front-end complement, very good, with reference value, the need for friends can refer to the next
:
First: Complete after retrieving from the
NativePhpNo Refresh (verify+Refresh Verification Code)Overview: This case has not only realized the PHP registration page Verification Code No refresh refresh functionIt also realizes the non-refresh validation of the form. The effect is absolutely practical. This example is only a test sample, not database validation.The source file is divided into 2 parts : cod
Is my page, opens the homepage link to display is the main body section (left black box);Right sub-page (sub-page acquired via Ajax in the right Div#main_box)Display a sub-page that is loaded when a button is pressed when the page link is just opened
Now I press the button two o'clock loaded sub-page 2 has a form, you need to submit a form and then through PHP to
Recently received a more exotic demand, the other side requested in the enterprise station to add a similar word form, and for users to fill out and submit online.
After a closer look, the form has a field as high as 100, and this magnitude is quite scary. If each input manually to fill in the ID and name, what a terrible physical life ah.
Repeatedly think about it, in order to avoid the bitter forced to
This article mainly introduces the general database operation class-front-end easyui-datagrid and form (php). The implementation code is relatively simple, for more information about common database operations, see front-end easyui-datagrid and form (
When modifying a php form, how does one display the values of multiple selection boxes including the selected and unselected php forms? when modifying a php form, you must first check the data from the database and display it, but
, database syntax error tolerance, JS execution judgment, PHP Execution judgment, multiple consecutive carriage return line breaks and spaces. Some of these concepts have an inclusive relationship, the same below.The source code output is as follows (the JS script will be executed ):
Ii. Data Processing for form submission1. Force Add a backslashBecause some hos
Php submits a form to the user with the same effect as Weibo. after clicking submit, the following content is returned. how can this problem be achieved? for beginners, the traditional approach is: submitting is submitted to an plug-in framework on this page. you can also use AJAX to write the returned results back to this page through js. using jq's ajax is very simple. you can see it after checking the ma
This article provides a detailed analysis of php anti-injection and implementation of Form submission value escaping. For more information, see
This article provides a detailed analysis of php anti-injection and implementation of Form submission value escaping. For more information, see
During development, we
Php form data
input data should be validated using functions such as strip_tags and utf8_decode. Dynamics content should be HTML encoded using htmlspecialchars.
The data entered by the user is processed using strip_tags and utf8_decode. why should I use htmlspecialchars to read the data?
The tag has been removed with strip_tags.
Reply to discussion (solution)
If ($ text! = Strip_tags ($
This is to perform security analysis on a file that receives the freely submitted form data. I hope it will be helpful to you. First of all, the error () and succeed () in the code are self-defined functions used to display the error information and success Information. In fact, they can also directly echo the error information, here I just want to see the highlights of my error page and define a function for page output.
The code is as follows:
//
= M age = 35
Unfortunately, the amount of data transmitted through get is limited, and it is not safe (because the data is visible ).
Generally, get is used for request information, such as specific records in the database or search results (almost always get is used for search ).
The post method is used when an action is required (for example, when updating database records or sending emails.
For the
, HTML tags, links, unblocked HTML tags, database syntax error tolerance, JS execution judgment, PHP Execution judgment, multiple consecutive carriage return line breaks and spaces. Some of these concepts are inclusive.
Ii. Data Processing for form submission1. Force Add a backslash
Because some hosts enable the magic reference get_magic_quotes_gpc by default, an
Use the point of free time to write a blog, the most recent projects need to submit the form of audio, pictures, various types, put it into the database, here first of all, the music file form submission bar, after a few days to update the input database, first look at the effectClick to browseWill come out preview and
Some fields received by the form, such as the QQ number or something, are saved in the database after receiving them and converted into an image to save them. Is there any toolkit or something like that? Some fields received by the form, such as the QQ number or something, are saved in the database after receiving them
Introduction to the implementation method of PHP solution form Duplicate Submission
Repeated submission is a problem we often encounter in development, in addition to using JS to prevent the recurrence of forms, but also can use PHP to prevent duplicate submissions Oh.
Example 1
Code to copy the code as follows
/*
* How to prevent duplicate submissio
In the development, we should pay attention to prevent SQL injection, so in the form submitted to the value to do the corresponding processing, before the data can be updated to the database
PHP annihilation function. Any value can be passed over to convert
Copy CodeThe code is as follows:
function quotes ($content)
{
If Magic_quotes_gpc=off, then start processi
Php Cainiao asks how to extract the value points in the table from a page and submit them to the form below? Please give me some advice ------ solution -------------------- Upload the id of each line to the next page. The next page then queries the database by id. ------ Solution -------------------- are you using the same file? Didn't you let it go.
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.