?? index12.php
字號:
<?php
require "includes/class.template.php";
$template = new verySimpleTemplate();
if( !@$_POST['qq'] )
{
$template->deal( 'template/header.tpl' );
$h = $template->template;
$template->deal( 'template/qBody.tpl' );
$b = $template->template;
$template->deal( 'template/footer.tpl' );
$f = $template->template;
echo $h . $b . $f;
exit();
}
else
{
$q = str_replace( '.', '', @$_POST['qq'] );
}
if( strlen( $q ) > 9 or strlen( $q ) < 5 or !is_numeric( $q ) or $q < 0 )
{
error( '對不起,你輸入的QQ號碼無效.請重新輸入.' );
exit();
}
else
{
$li = $q % 81;
$c = file( 'data/luck.dat' );
$t = explode( '|', $c[$li] );
$arrayVar = array();
$template->deal( 'template/header.tpl' );
$h = $template->template;
$template->deal( 'template/qBody.tpl' );
$b = $template->template;
$arrayVar = array (
'QQ' => $q,
'LUCKY' => $t[1],
'DES' => $t[0],
'TYPE' => $t[2]
);
$template->deal( 'template/qRender.tpl', $arrayVar );
$r = $template->template;
$template->deal( 'template/footer.tpl' );
$f = $template->template;
echo $h . $b . $r . $f;
}
function error( $e )
{
global $template;
$arrayVar = array();
$template->deal( 'template/header.tpl' );
$h = $template->template;
$template->deal( 'template/qBody.tpl' );
$b = $template->template;
$arrayVar = array (
'ERROR' => $e
);
$template->deal( 'template/errorRender.tpl', $arrayVar );
$r = $template->template;
$template->deal( 'template/footer.tpl' );
$f = $template->template;
echo $h . $b . $r . $f;
}
?>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -