綜合圖片計數器

——————————————————————————–  
請保持文章的完整性  
————————————————————————————–  
<?  
//counter.php(做為現在的主流開發語言) All rights reserved https://sports98.126.com  
//類似163的計數器,可以申請使用,開通多用戶服務,[圖片計數器]v1.00 代碼免費,如果您使用本代碼請保證您的代碼也要完全公佈  

$counterfile=”./counter/${name}.txt”; //定義數據文件;  
$fp=fopen(“$counterfile”,”rw”); //打開數據文件  
$usernumber=fgets($fp,8); //取出數據文件數據  
$usernumber+=1; //將數據計算  
$int_counter=$usernumber; //分出一個操作變量  
$int_pan=10000000; //定義被除數  
for($int_b1=0;$int_b1<=7;$int_b1++) //此循環為判定數據將數據更改為圖象位置  
{  
$int_a[$int_b1]=$usernumber / $int_pan;  
$int_a[$int_b1]=intval($int_a[$int_b1]);  
$int_a_a[$int_b1]=selectpic($int_a[$int_b1],$xxxx); /* 註意這裡如果是單用戶可以省略使用函數,使用函數是為瞭多用戶使用,將數據加密使用 */  
$usernumber=$usernumber % $int_pan;  
$int_pan=$int_pan /10;  
}  
echo “<p style=”border:dotted;width:xxx;border-color:${rgb};height:xxx;cursor:hand;”>”; //輸出數據圖象框架  
for($int_la=0;$int_la<=7;$int_la++)  
{  
echo “$int_a_a[$int_la]”; //輸出數據圖象  
}  
echo “</p>”;  
exec(“del $counterfile”); //刪除數據文件防止追加  
//unix 下使用 exec(“rm -vf $counterfile”);  
exec(“echo $int_counter > $counterfile”); //添加最新數據到文件內  
function selectpic($int_tmp,$path) //判定圖片位置函數  
{  
$int_pic=”<img src=”/edu/UploadPic/2008-2/200821518045130.gif”>”;  
return($int_pic);  
}  
?>  
————————————————————————————  
<?  
//jsq.php(做為現在的主流開發語言)  
//申請的時候,最好使用數據庫將申請名單保存,以便以後發現盜用者,在這裡我沒考慮用戶驗證  
//可以直接生成這個文件就可以瞭  
if($submit){  
$db=MySQL(和PHP搭配之最佳組合)_connect(“host”,”name”,”password”) or die (“connect faild!”);  
MySQL(和PHP搭配之最佳組合)_select_db(“table”,$db);  
$query=”insert into table value(,)”;  
$result=MySQL(和PHP搭配之最佳組合)_query($query,$db);  
exec(“echo 0 > ./counter/${username}.txt”);  
print “<h1>恭喜!您已經成功的申請到服務瞭</h1>”;  
print “請使用以下代碼&lt;script language=javascript src=”https://host/cccc.php(做為現在的主流開發語言)?name=xxxx&xxxx=1&rgb=color”&gt;&lt;/script&gt;”;  
?>  
———————————————————————————–  
//cccc.php(做為現在的主流開發語言)  
document.write(“<? include “./counter.php(做為現在的主流開發語言)” ?>”);  

//註意本計數器 結合MySQL(和PHP搭配之最佳組合)後添加驗證就可以進行申請服務瞭。  
//調試在oso通過,在51順利通過,在2000+iis(微軟的WEB服務器平臺)5.0+php(做為現在的主流開發語言)4.0.5順利通過 

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *