Php simple method of handling form input special characters, form special characters _php tutorial

Source: Internet
Author: User
Tags php regular expression

Php simple method of handling form input special characters, form special characters


This article describes a simple way for PHP to handle special characters of form input. Share to everyone for your reference, as follows:

  <?php   if ($_post[' submitted '] = = "Yes") {    $yourname = $_post[' yourname '];    $yourname = Trim ($yourname);    $yourname = Strip_tags ($yourname);    $yourname = Htmlspecialchars ($yourname);    $yourname = Addslashes ($yourname);    Echo $yourname. "
"; ? >try again<?php } if ($_post[' submitted ']! = "Yes") { ?> <?php }

More readers interested in PHP related content can view this site topic: "PHP String Usage Summary", "PHP Operations and Operator Usage Summary", "PHP Basic Syntax Primer tutorial" and "PHP Prevention SQL injection Method Summary"

I hope this article is helpful to you in PHP programming.

Articles you may be interested in:

    • A summary of the filtering and processing methods for submitting special characters to the form by PHP
    • LTrim and RTrim in PHP remove left and right spaces and special character instances
    • PHP uses Trim function to remove left and right spaces and special character instances
    • Old PHP escape functions for special characters in JSON
    • function code for PHP to replace special characters in extra-long text
    • PHP regular Expression Special characters [: Alnum:] [: alpha:] etc.
    • PHP implementation code with slashes before special characters
    • PHP Special character processing function

http://www.bkjia.com/PHPjc/1098688.html www.bkjia.com true http://www.bkjia.com/PHPjc/1098688.html techarticle php Simple method of processing form input special characters, form special characters This article describes a simple way for PHP to handle the special characters of form input. Share to everyone for reference, with ...

  • Related Article

    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.