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.
26 lines
712 B
26 lines
712 B
<?php
|
|
/*
|
|
* Created on 12.07.2008
|
|
*
|
|
* @copyright (c) 2009 animegame.eu
|
|
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
|
|
*
|
|
*/
|
|
include_once(ROOT_PATH.'/include/random.inc.php');
|
|
|
|
function createAbholcode($charid){
|
|
$code = mt_random_wrapper(0, 44*$charid);
|
|
$code = md5($code.time());
|
|
mysql_query('DELETE from char_abholcodes where charid = '.$charid);
|
|
mysql_query('INSERT INTO char_abholcodes(charid, code) values('.$charid.', \''.$code.'\')');
|
|
}
|
|
|
|
function checkAbholcode($charid, $code){
|
|
$code_row = mysql_fetch_assoc(mysql_query('Select * from char_abholcodes where charid = '.$charid));
|
|
if($code_row){
|
|
return $code == $code_row['code'];
|
|
}
|
|
return true;
|
|
}
|
|
?>
|