Serv-u web account application program written in PHP_PHP tutorial

WBOY
Release: 2016-07-21 16:07:15
Original
741 people have browsed it

//Sign.php
//The system is suitable for win2000
$path="e:\serv-u\ServUDaemon.ini";//The path of the user file
$fabu ="e:\web\";//Total web path
if($add)
{
$fp1=fopen($path,"r+");
$str=fread( $fp1, filesize($path));
$fp=fopen($path,"a");
flock($fp,3);
$us="=".$userid;
$start=strpos($str,$us);
if($start)
{
echo "Sorry, the user already exists";
}else{
$ start1=strpos($str,"User1");
if($start1){
$start=$start1+6;
$end=strpos($str,"|",$start) ;
$firstusername=substr($str,$start,$end-$start);
$start2=strpos($str,"[USER=".$firstusername."|1]");
$usernum=count(split("rn",substr($str,$start1,$start2-$start1)));
             }else
                                    }
$userinfo="User".$usernum."=".$userid."|1|0"."rn";
$userpath=$fabu.$userid;
@mkdir( $userpath,0700);
$maxsize=$size*1024;
$userp="[USER=".$userid."|1]"."rn";
$userp.=" Password=".$password."rn";
$userp.="HomeDir=".$userpath."rn";
$userp.="RelPaths=1"."rn";
$userp.="DiskQuota=1|".$maxsize."|0"."rn";
$userp.="MaxUsersLoginPerIP=2"."rn";
$userp.="TimeOut= 600"."rn";
$userp.="Access1=".$userpath."|RWAMLCDP"."rn";

if($start2){
$content=substr ($str,$start2,strlen($str)-$start2);
$content.=$userp;
$userinfo.=$content;
fseek($fp1,$start2,SEEK_SET) ;
fputs($fp1,$userinfo);
}else
                                           
//echo $firstusername;
//echo $start;
//echo "
";
//echo $end;


   }
fclose($fp);
fclose($fp1);
}
?>




Account:
Password:

Space size: M







http://www.bkjia.com/PHPjc/315146.html

www.bkjia.com

truehttp: //www.bkjia.com/PHPjc/315146.htmlTechArticle? //Sign.php //The system is suitable for win2000 $path=e:\serv-u\ServUDaemon. ini;//Path of user file $fabu=e:\web\;//Total web path if($add) { $fp1=fopen($path,r+); $str=fread($fp1, file.. .
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