Home Backend Development PHP Tutorial 用php写的serv-u的web申请账号的程序_PHP

用php写的serv-u的web申请账号的程序_PHP

Jun 01, 2016 pm 12:27 PM
start str Apply program account

Serv-U


//Sign.php
//系统适用于win2000
$path="e:\\serv-u\\ServUDaemon.ini";//用户文件的路径
$fabu="e:\\web\\";//总web路径
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 "对不起,该用户已经存在";
}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("\r\n",substr($str,$start1,$start2-$start1)));
}else
{
$usernum=1;
}
$userinfo="User".$usernum."=".$userid."|1|0"."\r\n";
$userpath=$fabu.$userid;
@mkdir($userpath,0700);
$maxsize=$size*1024;
$userp="[USER=".$userid."|1]"."\r\n";
$userp.="Password=".$password."\r\n";
$userp.="HomeDir=".$userpath."\r\n";
$userp.="RelPaths=1"."\r\n";
$userp.="DiskQuota=1|".$maxsize."|0"."\r\n";
$userp.="MaxUsersLoginPerIP=2"."\r\n";
$userp.="TimeOut=600"."\r\n";
$userp.="Access1=".$userpath."|RWAMLCDP"."\r\n";

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


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


账号:
密码:

空间大小: M


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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to make Google Maps the default map in iPhone How to make Google Maps the default map in iPhone Apr 17, 2024 pm 07:34 PM

How to make Google Maps the default map in iPhone

How to have multiple accounts on Xiaohongshu? How does it have traffic? How to have multiple accounts on Xiaohongshu? How does it have traffic? Mar 24, 2024 pm 03:36 PM

How to have multiple accounts on Xiaohongshu? How does it have traffic?

How to change the mobile phone number of Xiaohongshu account? Will there be any impact if I change my mobile phone number? How to change the mobile phone number of Xiaohongshu account? Will there be any impact if I change my mobile phone number? Mar 22, 2024 am 08:11 AM

How to change the mobile phone number of Xiaohongshu account? Will there be any impact if I change my mobile phone number?

What should I do if I can't log in to my Google Chrome account? Google account shows unable to log in solution What should I do if I can't log in to my Google Chrome account? Google account shows unable to log in solution Mar 17, 2024 am 08:30 AM

What should I do if I can't log in to my Google Chrome account? Google account shows unable to log in solution

How do I have two Xiaohongshu accounts? What use does having two Xiaohongshu accounts do to creators? How do I have two Xiaohongshu accounts? What use does having two Xiaohongshu accounts do to creators? Mar 21, 2024 pm 10:11 PM

How do I have two Xiaohongshu accounts? What use does having two Xiaohongshu accounts do to creators?

What should I do if my Kuaishou account is activated abnormally? -How to turn off Kuaishou password-free payment? What should I do if my Kuaishou account is activated abnormally? -How to turn off Kuaishou password-free payment? Mar 18, 2024 pm 01:30 PM

What should I do if my Kuaishou account is activated abnormally? -How to turn off Kuaishou password-free payment?

How to apply for a refund on Alipay How to apply for a refund on Alipay Feb 24, 2024 am 08:30 AM

How to apply for a refund on Alipay

How to write a simple countdown program in C++? How to write a simple countdown program in C++? Nov 03, 2023 pm 01:39 PM

How to write a simple countdown program in C++?

See all articles