Location: PHPKode > scripts > Image2HTML > image2html/client.php
<?php
include('image2html.class.php');

$userTimeStamp = time();
mkdir("conversions/" . $userTimeStamp, 777);
$uploadedFilePath = "conversions/" . $userTimeStamp . "/" . $_FILES["imagefilefromform"]["name"];

if ((($_FILES["imagefilefromform"]["type"] == "image/gif")
|| ($_FILES["imagefilefromform"]["type"] == "image/jpeg")
|| ($_FILES["imagefilefromform"]["type"] == "image/pjpeg"))
&& ($_FILES["imagefilefromform"]["size"] < (50 * 1024)))
{
  if ($_FILES["imagefilefromform"]["error"] > 0)
  {
    echo "Return Code: " . $_FILES["imagefilefromform"]["error"] . "<br />";
  }
  else
  {
    if (file_exists($uploadedFilePath))
    {
      echo $_FILES["imagefilefromform"]["name"] . " already exists. ";
    }
    else
    {
      move_uploaded_file($_FILES["imagefilefromform"]["tmp_name"], $uploadedFilePath);      
    }
  }
}

$Image2TextInstance = new Image2Html($uploadedFilePath, $uploadedFilePath . ".html", "█", 400, 300);
$Image2TextInstance->GetHtmlFromImage();
$Image2TextInstance->WriteToFile();
?>
<html>
<head>
<meta name="keywords" content="convert,image,html,text,convert image to text,convert image to html,reza salehi,reza,salehi" />
</head>
<body bgcolor="#eeeeee">
<h2>Image To HTML Converter!</h2>
Your original image: <br />
<img src="<?php print($uploadedFilePath); ?>" />
<br />
The HTML/Text version of your image: <br />
<?php print($Image2TextInstance->_textData); ?>
<br />
You can also download the generated HTML <a href="<?php print($uploadedFilePath . ".html"); ?>" target="blank">here</a>.
 Right click and select Save Target As...
<br />
<a href="index.html">Try another image!</a>
<br /><br />
<h6>Programmed By Reza Salehi, hide@address.com</h6>
</body>
</html>
Return current item: Image2HTML