Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP DISABLE HTML ON MEMBERS PAGE
#2
Your clean() function doesn't really prevent anything.
PHP Code:
function clean($str) {
        
$str = @mysql_real_escape_string(trim(htmlentities($strENT_QUOTES)));
        if(
get_magic_quotes_gpc()) {
            
$str stripslashes($str);
        }
        return 
mysql_real_escape_string($str);
    } 

The function htmlentities() takes characters like "<" and ">" and turns them into html entity "&lt;" and "&gt;", "&" = &amp;..... and so on.
You can also use htmlspecialchars(), but I prefer htmlentities().

http://php.net/manual/en/function.htmlentities.php
http://www.supportforums.net/showthread.php?tid=700


Reply


Messages In This Thread
RE: PHP DISABLE HTML ON MEMBERS PAGE - by Gaijin - 05-14-2011, 02:45 PM
RE: PHP DISABLE HTML ON MEMBERS PAGE - by Sly - 05-14-2011, 09:07 PM
RE: PHP DISABLE HTML ON MEMBERS PAGE - by Sly - 05-14-2011, 09:10 PM
RE: PHP DISABLE HTML ON MEMBERS PAGE - by Sly - 05-14-2011, 09:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 795 07-27-2020, 11:26 PM
Last Post: tk-hassan
  [PHP] Very Basic Login Page BreShiE 17 7,109 07-11-2013, 05:57 AM
Last Post: 1n9i9c7om ツ
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,320 10-10-2011, 01:00 PM
Last Post: Greyersting
  PHP error on page submit kaosjon 7 2,216 09-18-2011, 03:31 AM
Last Post: AceInfinity
  HTML&PHP Games. flAmingw0rm 25 3,661 06-04-2011, 07:23 AM
Last Post: Strafeness

Forum Jump:


Users browsing this thread: 1 Guest(s)