PHP implements shake roll call program
Aug 08, 2016 am 09:28 AMProfessor Lu’s needs:
<form name="input" action="#" method="post"> Password:<input name="auth" value="<?php echo $_POST['auth']?>" type="password"><br> Number:<input type="text" name="i"><br> Work:<input type="text" name="id"> <input type="submit" value="Submit" /></form> <?php //echo md5("ojtest"); date_default_timezone_set('Asia/Shanghai');#设置时区 //$_POST['auth']=1; //$_GET['test']=0;#是否为测试模式 默认为否 //echo md5('1'); function ini($num) { $values=parse_ini_file('name.ini');#解析ini文件 格式 : 姓名=学号 return array_search($num,$values);#查找对应学号的姓名 } if(md5($_POST['auth'])=='d49c880dd3d6e572ff1611f36b4ce04a') { error_reporting(0); $I=$_POST['i'];#数量 for($k=0;$k<$I;$k++) { $r=mt_rand(1,52); while($r==31)$r=mt_rand(1,52); echo '<img src="'.$r.'.jpg"/><br>';//<img src="1.jpg" height=100 width=100 > if($r>26)$r=3200+$r-26; else $r=3100+$r; echo $r."<br>".ini($r)."<br>"; $nm=ini($r); //file_put_contents("./data.txt",$r); //file_put_contents("./data.txt","\r\n"); $tim=date("y-m-d H:i:s"); $f=fopen("./data.xls", "a"); $id=$_POST['id']; // $id; if($id==NULL)fclose($f); fwrite($f,"$r\t$nm\t$tim\t$id\r\n");#便于用excel打开 fclose($f); } } ?>
The above introduces the implementation of the shake roll call program in PHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

What are the differences between Huawei GT3 Pro and GT4?

Fix: Snipping tool not working in Windows 11

A brief analysis of the POST method in PHP with parameters to jump to the page

How to determine whether a post has been submitted in PHP

How to Fix Can't Connect to App Store Error on iPhone

How does java initiate an http request and call the post and get interfaces?

How to solve the problem that NGINX reverse proxy returns 405 for POST request of HTML page
