<?php
/*
1.产生随机数
2.插入表
3.查询
4.返回yes
*/
function mak() //生成卡号密码算法 可替换;
{
$str=md5(microtime());
$pass=substr($str,-12);
return $pass;
}
///生成卡号密码并存入数据库$times=你想添加的卡号密码条数
function sqlconn($times)
{
$con=mysql_connect("127.0.0.1","root","");
if(!$con)
{
die('Connect database................[ERROR]:'.mysql_error());
}
else echo "Connect database server................[OK]<br>";
$cmd="CREATE DATABASE num_psw";
if(mysql_query($cmd,$con))echo "Creat database................[OK]<br>";
else
{
echo 'Creat database................[ERROR]:'.mysql_error()."<br>";
}
mysql_select_db("num_psw",$con);//选择数据库
$cmd="CREATE table numpsw(auth1 varchar(25),auth2 varchar(25))";
if(mysql_query($cmd,$con))echo "Creat table................[OK]<br>";
else
{
echo 'Creat table................[
php实现点卡卡号密码生成
最新推荐文章于 2022-01-14 13:22:32 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)