March 07, 2011

PHP - Mysql sanitizer function

This is my sanitizer function that I use on every variable before placing them in a query.
Hope you like it.

5 comments:

  1. does it secures script

    ReplyDelete
  2. can u help me
    while i used
    php_value auto_prepend_file filename.php
    in .htaccess

    my site showed an error :

    Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

    Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

    Fatal error: Unknown: Failed opening required 'filename.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0

    where's the error

    ReplyDelete
  3. Mahesh, you must use absolute path of filename.php for this. Do it like this:

    php_value auto_prepend_file /home///filename.php

    Also in case .htaccess directive is ignored, you can edit httpd.conf file to do the same or manually prepend the file in each and every php file.

    ReplyDelete
  4. how to use this sanitize function and where please ellaborate

    ReplyDelete