Comprehensive picture counter_PHP tutorial

WBOY
Release: 2016-07-21 16:07:58
Original
861 people have browsed it

-------------------------------------------------- -------------------------------
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("" );

//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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/314996.htmlTechArticle--------------------- -------------------------------------------------- ------Please maintain the integrity of the article----------------------------------------- ----------------------------------...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template