代码如下 | 复制代码 |
function pinyin($_string, $_code='utf-8') $_datavalue = "-20319|-20317|-20304|-20295|-20292|-20283|-20265|-20257|-20242|-20230|-20051|-20036|-20032|-20026|-20002|-19990". $_data = (php_version>='5.0') ? array_combine($_tdatakey, $_tdatavalue) : _array_combine($_tdatakey, $_tdatavalue); if($_code != 'gb2312') $_string = _u2_utf8_gb($_string); function _pinyin($_num, $_data) function _u2_utf8_gb($_c) function _array_combine($_arr1, $_arr2) |
代码如下 | 复制代码 |
header("content-type: text/html; charset=utf-8"); error_reporting(0); include "../libs/fetion.class.php教程";
$help = '帮助:如果需要群发多号用英文逗号(,)分隔(159..,159..),有更多建议请联系 qq:85431993<br>e-mail:threesky@gmail.com'; $api = "本站接口:<br>http://api.heqee.com/fetion/?username=飞信手机号码&passowrd=飞信手机密码&to=接收人号码&message=短信内容<br>或者<br>http://api.heqee.com/fetion/?u=飞信手机号码&p=飞信手机密码&t=接收人号码&m=短信内容"; if($demo!=""){ function error($msg){ switch($send){ $fetion = new fetion($send['username'], $send['password']); $fetion->send($send['to'],$send['message']);
?> |
//实例应用
代码如下 | 复制代码 |
<?php |
/*
* created on 2010-6-21
*
* the class for image to upload
*
* made by s71ence
*
* @$user_id
* @$max_file_size
* @$max_image_side
* @$destination_folder
*
* return:
* @$_cookie['img_path']
* @$img_unfind
* @$img_type
* @$mkdir_warry
* @$img_side_too_big
* @$img_exist
* @$img_move
* @$img_upload_sucess
*/
代码如下 | 复制代码 |
header('content-type:text/html;charset=utf-8'); function __construct($user_id,$max_file_size,$max_image_side,$destination_folder,$img_preview,$img_preview_size,$cookie_set) private function get_date() function get_image_type() return $this->up_img_types; function upload_image() $file = $_files["upfile"]; //check the iamge's size //check the iamge's type if(!file_exists($this->destination_folder)) $file_name=$file["tmp_name"]; if($image_size[0]>$this->max_image_side || $image_size[1]>$this->max_image_side) $overwrite=""; if(!move_uploaded_file ($file_name, $destination)) $img_upload_sucess="<font color=red face=微软雅黑>上传成功</font><br>"; function __destruct() |
if ('source' == $_get['act']) { //查看源代码
show_source($_server["script_filename"]);
exit;
} //end if
set_time_limit(0);
for ($i = 0; $i < 5000; $i++) {
$users[] = 'tom_' . $i;
} //end for
$width = 500; //显示的进度条长度,单位 px
$total = count($users); //总共需要操作的记录数
$pix = $width / $total; //每条记录的操作所占的进度条单位长度
$progress = 0; //当前进度条长度
?>
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<style>
body, div input { font-family: tahoma; font-size: 9pt }
</style>
<script language="网页特效">
<!--
function updateprogress(smsg, iwidth)
{
document.getelementbyid("status").innerhtml = smsg;
document.getelementbyid("progress").style.width = iwidth + "px";
document.getelementbyid("percent").innerhtml = parseint(iwidth / <?php echo $width; ?> * 100) + "%";
}
//-->
</script>
</head>
<body>
<div style="margin: 4px; padding: 8px; border: 1px solid gray; background: #eaeaea; width: <?php echo $width+8; ?>px">
<div><font color="gray">如下进度条的动态效果由服务器端 php 程序结合客户端 网页特效 程序生成。</font></div>
<div style="padding: 0; background-color: white; border: 1px solid navy; width: <?php echo $width; ?>px">
<div id="progress" style="padding: 0; background-color: #ffcc66; border: 0; width: 0px; text-align: center; height: 16px"></div>
</div>
<div id="status"> </div>
<div id="percent" style="position: relative; top: -30px; text-align: center; font-weight: bold; font-size: 8pt">0%</div>
</div>
<?php
flush(); //将输出发送给客户端浏览器
foreach ($users as $user) {
// 在此处使用空循环模拟较为耗时的操作,实际应用中需将其替换;
// 如果你的操作不耗时,我想你就没必要使用这个脚本了 :)
for ($i = 0; $i < 10000; $i++) {
;;
}
?>
<script language="javascript">
updateprogress("正在操作用户"<?php echo $user; ?>" ....", <?php echo min($width, intval($progress)); ?>);
</script>
<?php
flush(); //将输出发送给客户端浏览器,使其可以立即执行服务器端输出的 javascript 程序。
$progress += $pix;
} //end foreach
// 最后将进度条设置成最大值 $width,同时显示操作完成
?>
<script language="javascript">
updateprogress("操作完成!", <?php echo $width; ?>);
</script>
<?php
flush();
?>
<input type="button" value="查看源码" onclick="document.location.href='<?php echo $_server['php_self']; ?>?act=source'" />
</body>
</html>
代码如下 | 复制代码 |
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <body> |
loginajax.php文件代码
<!--{因为loginajax.php是由js形式调用输出,所以在这个文件里面的代码由于按js输出形式才能正确被显示哦。}-->
代码如下 | 复制代码 |
<?php |
本文章原创于http://www.111cn.net/phper/php.html转载注明来源,谢谢合作。