-------------------------------------------------- -------------------------------
Please maintain the integrity of the article
-------- -------------------------------------------------- -------------------------------
//counter.php All rights reserved http://sports98 .126.com
//A counter similar to 163 can be applied to open multi-user services. [Picture Counter] v1.00 code is free. If you use this code, please ensure that your code is fully disclosed
$counterfile="./counter/${name}.txt"; //Define data file;
$fp=fopen("$counterfile","rw"); //Open data file
$usernumber=fgets($fp,8); //Get the data file data
$usernumber+=1; //Calculate the data
$int_counter=$usernumber; //Split out an operating variable
$int_pan=10000000; //Define the dividend
for($int_b1=0;$int_b1<=7;$int_b1++) //This loop changes the data to the image position to determine the data
{
$ 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); /* Note that if it is a single user, you can omit the use of the function. The function is used for multi-user use to encrypt the data*/
$usernumber=$usernumber % $int_pan;
$int_pan= $int_pan /10;
}
echo "
"; //Output data image frame
for($int_la=0;$int_la<=7;$int_la++)
{
echo "$int_a_a[$int_la]"; //Output data image
}
echo "
";
exec("del $counterfile"); //Delete the data file to prevent appending
//Use exec("rm -vf $counterfile under Unix ");
exec("echo $int_counter > $counterfile"); //Add the latest data to the file
function selectpic($int_tmp,$path) //Determine the picture position function
{
$int_pic="
";
return($int_pic);
}
?> ;
------------------------------------------------- -----------------------------------------------
//jsq .php
//When applying, it is best to use a database to save the application list in order to detect theft in the future. I did not consider user verification here
//You can directly generate this file
if ($submit){
$db=mysql_connect("host","name","password") or die ("connect faild!");
mysql_select_db("table",$db);
$query="insert into table value('','')";
$result=mysql_query($query,$db);
exec("echo 0 > ./counter/${username }.txt");
print "
Congratulations! You have successfully applied for the service
";
print "Please use the following code";
?>
------------- -------------------------------------------------- -------------------
//cccc.php
document.write(" include "./counter.php" ?>" );
//Note that after combining this counter with mysql and adding verification, you can apply for services.
//Debugging passed in oso, successfully passed in 51, passed smoothly in 2000+iis5.0+php4.0.5
http://www.bkjia.com/PHPjc/314996.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/314996.htmlTechArticle--------------------- -------------------------------------------------- ------Please maintain the integrity of the article----------------------------------------- ----------------------------------...