Jump to content

Html input


rofl90

Recommended Posts

Yep, thats exactly how you use it. Although I would use mysql_real_escape_string() with it too. You have to make sure you escape the data AFTER the purifying though. Like this:

 

$clean_html = mysql_real_escape_string($purifier->purify($dirty_html));

Link to comment
https://forums.phpfreaks.com/topic/95154-html-input/#findComment-487411
Share on other sites

Is this ok then:

 

if(isset($_POST['add']))
{

    require_once '../htmlcleaner/library/HTMLPurifier.auto.php';
    
    $purifier = new HTMLPurifier();
    $footer = $purifier->purify($footer1);
$sitetitle = $purifier->purify($sitetitle2);
$keywords = $purifier->purify($keywords3);
$description = $purifier->purify($description4);
$timeout = $purifier->purify($timeout5);
$maintenance = $purifier->purify($maintenance6);
$siteslogan = $purifier->purify($siteslogan7);

$footer1 = $_POST['footer'];
$sitetitle2 = $_POST['sitetitle'];
$keywords3 = $_POST['keywords'];
$description4 = $_POST['description'];
$timeout5 = $_POST['timeout'];
$maintenance6 = $_POST['maintenance'];
$siteslogan7 = $_POST['siteslogan'];
$query = "UPDATE settings SET footer='$footer', sitetitle='$sitetitle', keywords='$keywords', description='$description', timeout='$timeout', maintenance='$maintenance', siteslogan='$siteslogan'";
mysql_query($query) or die(mysql_error());

echo "Updated settings! Click <a href='settings.php'>here</a> to go back.";
}

Link to comment
https://forums.phpfreaks.com/topic/95154-html-input/#findComment-487416
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.