forked from mohuishou/ImageOCR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudy.php
43 lines (39 loc) · 1.08 KB
/
study.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* Created by mohuishou<[email protected]>.
* User: mohuishou<[email protected]>
* Date: 2016/5/1 0001
* Time: 20:44
*/
require_once 'vendor/autoload.php';
$db=new \Mohuishou\ImageOCR\StorageFile();
//$a=$db->get();
//print_r($a);
if(isset($_POST['send'])&&$_POST['send']=="send"){
$image=new \Mohuishou\ImageOCR\Image("./img/inImgTemp.png");
$code=$_POST['code'];
$code_arr=str_split($code);
for($i=0;$i<$image::CHAR_NUM;$i++){
$hash_img_data=implode("",$image->splitImage($i));
$db->add($code_arr[$i],$hash_img_data);
}
echo "<script>location.href='./study.php?t=".time()."'</script>";
}else{
$image=new \Mohuishou\ImageOCR\Image("http://www.169ol.com/Mall/Code/getCode&1462104790492");
imagepng($image->_in_img,"./img/inImgTemp.png");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Study</title>
</head>
<body>
<form action="" method="post">
<img src="img/inImgTemp.png">
<input type="text" name="code">
<input name="send" type="submit" value="send" />
</form>
</body>
</html>