Basic PHP document management system, including automatic detection of corporate logos in letters
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ocr.php 601B

12345678910111213141516171819202122
  1. <?PHP
  2. require_once('database.inc.php');
  3. $image = $_POST['image'];
  4. if (!preg_match('/^([a-z]+\/)+[a-z]+[-_][0-9]+\.jpe?g$/', $image) || !file_exists($image)) {
  5. die('Error: ' . htmlentities($image));
  6. }
  7. $db = substr($image, 5);
  8. $sql = 'SELECT ocr_gocr, ocr_ocrad FROM ocrresults WHERE ocr_image = \'' . mysql_real_escape_string($db) . '\'';
  9. $res = mysql_query($sql);
  10. $row = mysql_fetch_assoc($res);
  11. ?>
  12. <h2>OCR results</h2>
  13. <h3>gOCR</h3>
  14. <textarea><?PHP echo htmlentities($row['ocr_gocr']); ?></textarea>
  15. <h3>OCRad</h3>
  16. <textarea><?PHP echo htmlentities($row['ocr_ocrad']); ?></textarea>