HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/ledub.komma.pro/wwwroot/converter/converter.php
<?php
/**
 * Created by PhpStorm.
 * User: joepvanhunsel
 * Date: 12-02-14
 * Time: 10:38
 */
$output = "";

if(isset($_POST['tekst'])){
    $tekst = $_POST['tekst'];

    $str = encodeForDb($tekst);

    $output = str_replace("&","&amp;",$str);


}

function encodeForDb($str)
{
    // Remove whitespace
    $str = trim($str);

    // Convert html text to utf-8 special characters
    $str = htmlentities($str, ENT_NOQUOTES, 'utf-8');

    // Keep html tags
    $str = str_replace("&lt;","<",$str);
    $str = str_replace("&gt;",">",$str);
    $str = str_replace("&amp;","&",$str);

    return $str;
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="Author" content="Komma, (c) Komma Mediadesign, 2013. All Rights Reserved." />
    <meta name="Subject" content="utf-8 converter" />
    <meta name="Description" content="utf-8 converter" />
    <meta name="Language" content="Nederlands" />
    <title>Converter</title>
</head>

<body>
<h2>converter</h2>
<?php if ($output != "")
    {
        echo ($output);
    }
?>

<br/>
<br />
<form method="post" action="converter.php">
    <textarea name="tekst" cols=80 rows=10></textarea>
    <input type="submit">
</form>


</body>

</html>