-
Notifications
You must be signed in to change notification settings - Fork 29
/
captcha_mp3.php
40 lines (29 loc) · 981 Bytes
/
captcha_mp3.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
<?php
require_once('include/bittorrent.php');
dbconn(false);
/*
* To-Do:
* Implement captcha code regen when user used it
* Don't cache signup page, for new link regen
* Probable issues:
* If not using Db for storage, but use PHP sessions
* then two requests for captcha from different pages
* will create bad user experience.
* Must circumvent this issue in elegant manner.
*/
if($_GET['imagehash'] == "test") {
$imagestring = "Yuna";
} else {
$query = sql_query("SELECT * FROM captcha WHERE imagehash = ".sqlesc($_GET['imagehash'])." LIMIT 1") or sqlerr(__FILE__,__LINE__);
$regimage = mysql_fetch_array($query);
$imagestring = $regimage['imagestring'];
}
/* load php5 class file */
require_once('./include/mp3captcha.php');
/* init mp3captcha class with captcha value from session*/
$mp3 = new mp3captcha($imagestring);
/* use language mapping */
$mp3->mapping = true;
/* output captcha mp3 */
$mp3->mp3stitch();
?>