Escaping user-passed variables, excerpted from ecshop_php tutorial

Source: Internet
Author: User
Tags smarty template
The user-passed variable is escaped and processed, and is excerpted from Ecshop.

/* Escapes the variable passed in by the user. */if (!GET_MAGIC_QUOTES_GPC ()) {    if (!empty ($_get)) {$_get  = Addslashes_deep ($_get);}    if (!empty ($_post)) {$_post = Addslashes_deep ($_post);}    $_cookie   = Addslashes_deep ($_cookie);    $_request  = Addslashes_deep ($_request);} /* Escape the special characters in the variable recursively */function addslashes_deep ($value) {return empty ($value)? $value: Is_array ($value)? Array_map (' Addslashes_deep ', $value): Addslashes ($value);}

Articles you may be interested in

    • PHP methods for serializing variables in PHP Four types of serialization variables
    • According to the user input email to jump to the corresponding e-mail home
    • How to check MySQL startup time and how long it takes to run
    • Image magnification display effects Slimbox The most lightweight features of the most powerful jquery image amplification effect
    • Powerful PHP Image processing class (watermark, transparency, zoom, sharpen, rotate, flip, cut, invert)
    • Use PHP functions in Smarty Templates and how to use multiple functions for a variable in a smarty template
    • Compress website js and CSS files using PHP's gzip compression to speed up website access
    • How PHP determines whether the current operating system is Linux or Windows

http://www.bkjia.com/PHPjc/764179.html www.bkjia.com true http://www.bkjia.com/PHPjc/764179.html techarticle The user-passed variable is escaped and processed, and is excerpted from Ecshop. /* Escapes the variable passed in by the user. */if (!GET_MAGIC_QUOTES_GPC ()) {if (!empty ($_get)) {$_get = Addsla ...

  • 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.