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

2016-01-29 14:39 23 1 收藏

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

【 tulaoshi.com - PHP 】

 

<?
//Sign.php
//系统适用于win2000
$path="e:serv-uServUDaemon.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("rn",substr($str,$start1,$start2-$start1)));
        }else
        {
$usernum=1;
        }
$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
        {
fputs($fp,$userinfo);
fputs($fp,$userp);
        }
//echo $firstusername;
//echo $start;
//echo "<br";
//echo $end;

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/php/)


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

 

<FORM METHOD=POST ACTION="sign.php"
账号:<INPUT TYPE="text" NAME="userid" size=10 maxlength=20 <br密码:
<INPUT TYPE="password" name="password" size=10 maxlength=20 <br空间大小:<INPUT TYPE="text" NAME="size" size=4 maxlength=4 M<br<INPUT TYPE="submit" name="add" value="增加用户"
</FORM

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/php/) 

来源:http://www.tulaoshi.com/n/20160129/1493850.html

延伸阅读
标签: Web开发
$ftp_server = "*.*.*.*"; $ftp_user = "lu"; $ftp_pass = "love you"; // set up a connection or die $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); $login_result = ftp_login($conn_id, $ftp_user, $ftp_pass); if ((!$conn_id) || (!$login_result)) {       &nbs...
标签: PHP
第一步:首先作一个如下面的表单:(注:这个表单里加了php程序) 你好朋友: ...
标签: ASP
  <% ' 分页程序 ' total_records 总记录数 ' everypage_records 每页显示条数 ' current_page 当前页数 ' url 要传递的url,这里可以含有要传递的变量,比如 "list.asp?" 或者"list.asp?keyword=key&" ' 程序调用比较简单,不过还是比PHP的麻烦,继续努力中 sub show_page(total_records,everypage_records,current_page,url) ...
标签: PHP
  <html   <head   <meta http-equiv="Content-Type" content="text/html; charset=gb2312"   <title查询条件</title   <meta name="GENERATOR" content="Microsoft FrontPage 3.0"   </head   <body bg...
标签: PHP
  guestbook.php: <head <meta http-equiv="Content-Language" content="zh-cn" <meta http-equiv="Content-Type" content="text/html; charset=gb2312" <title</title <STYLEA:link {         COLOR: #002878; TEXT-DECORATI...

经验教程

546

收藏

29
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部