Solutions to massive data loss submitted by textarea in asp and php

Source: Internet
Author: User
In asp and php, textarea submits a large amount of data and causes loss. I use textarea to submit a large amount of data.
Mediumtext is selected as the field type and data is lost.
Later I changed it to longtext, and the data is still lost,
In addition, it is found that the data volume submitted to the database is the same as that submitted by mediumtext,
Not added. How can this problem be solved?
In asp, you only need to use the following method.

The code is as follows:


Sub Content ()
Dim I, sContent
'Retrieve submitted data
'The Automatic processing of large forms is said to require loops. otherwise, content larger than 102399 KB may not be retrieved. The size of a single form item is limited to bytes (about KB ), .. See an editor ..
'Start value -----------------
SContent = ""
For I = 1 To Request. Form ("d_content"). Count
SContent = sContent & Request. Form ("d_content") (I)
Next
'End value -----------------
End Sub


Php is generally a special character. for the solution, refer to the following
What special characters are there? Unless you do not escape the quotation marks, you should be able to enter them.
Use get_magic_quotes_gpc to check the value. if it is 1, the POST data will be automatically escaped unless it is processed again. If the value is 0, insert the POST data addslashes. If not, and the value is 1, use stripslashes to convert the escaped data back, directly call mysql_escape_string to escape the data, and paste your special characters into the database if not.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.