⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 upload.php

📁 这是一个用c++builder编写的照片管理系统比较实用
💻 PHP
字号:
<? require("config.php"); 
if (empty($id) || empty($albumid)) exit;
if (!file_exists("user/$id/$albumid")) exit; 
$check=1;
if (empty($password) || empty($file_upload) || empty($des)) {$status="请填写资料"; $check=0;}
if ($check==1 && ereg("\|",$des)) {$check=0; $status="资料包含非法字符";}
if ($check==1 && $file_upload_type!="image/gif" && $file_upload_type!="image/pjpeg") {
$check=0; $status="不可识别的图形文件,请上传gif或jpg"; }
$checkpwd=0;
if ($check==1 && file_exists("user/$user_file")) {
  $user_list=file("user/$user_file");
  $count=count($user_list);
  for ($i=0; $i<$count; $i++){
    $detail=explode("|",$user_list[$i]);
    if ($detail[0]==$id && $detail[4]==$password) { $checkpwd=1; $useremail=$detail[2]; $userpicno=$detail[3]; $spaceused=$detail[5]; $mark=$i; $username=$detail[1]; break; }
  }
}
if ($check==1 && $checkpwd==0) {$check=0; $status="用户名/密码错误"; }
if ($check==1 && $file_upload_size+$spaceused>=$max_space) {$check=0; $status="用户剩余可用空间不足"; }
if ($check==1 && file_exists("user/$id/$albumid/$file_upload_name")) { $check=0; $status="文件已存在,请改名后上传"; }
if ($check==0) {
?>
<html>
<head>
<title>风事画馆</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="style.css" type=text/css rel=stylesheet>
</head>

<body bgcolor="<? echo $bg_color; ?>">
<table width="700" border="0" cellspacing="1" cellpadding="0" align="center">
  <tr> 
    <td width="206" align="center"><img src="images/pcd.jpg" width="200" height="60"></td>
    <td width="489" align="center"><? echo $advertise_html; ?></td>
  </tr>
</table>
<br>
<table width="450" border="0" cellspacing="1" cellpadding="0" align="center">
  <tr align="center"> 
    <td><b><? echo $pcd_title; ?></b></td>
  </tr>
</table>
<table width="500" border="0" cellspacing="1" cellpadding="0" align="center">
  <tr align="center"> 
    <td>添加新图画</td>
  </tr>
</table>
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#CCCCFF">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="1" cellpadding="0"><form method=post enctype="multipart/form-data">
      <input type="hidden" name="id" value="<? echo $id; ?>">
      <input type="hidden" name="albumid" value="<? echo $albumid; ?>">
      <tr> 
          <td><? echo $status; ?></td>
        </tr>
        <tr> 
            <td bgcolor=#ffffff> 
              <table width="100%" border="0" bgcolor="#FFFFFF">
                <tr valign="top" align="left" bgcolor="#eeeeee"> 
                  <td width="60" align="center" valign="middle"><b>密码:</b><br>
                  <a href="sendpwd.php">忘记了?</a>
                  </td>
                  
                  <td> 
                    <input <? if (!empty($pcduserpwd)) echo "value=\"$pcduserpwd\""; ?>
                    type="password" size="20" maxlength="75" name="password" value="" style="background-color:#ffffff; color:#0000ff; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
                    </td>
                </tr>
                <tr valign="top" align="left"> 
                  <td width="60" align="center" valign="middle">新图片:</td>
                  <td><b><font color="#800000"> 
                    <input type="file" name="file_upload" style="background-color:#ffffff; color:#0000ff; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
                    </font> </b></td>
                </tr>
                <tr valign="top" align="left"> 
                  <td width="60" align="center" valign="middle">注释:</td>
                  <td><b><font color="#800000"> 
                    <input maxlength=45 size=45 name=des style="background-color:#ffffff; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
                    </font> </b></td>
                </tr>
      
              </table>
            </td>
        </tr>
          <tr align="center"> 
            <td> 
              <input type="submit" value="送出资料" name="submit" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#ffffff; border:1 solid black" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#ffffff'">
              <input type="button" onclick="location.href='pcdlist.php?id=<? echo $id; ?>'" value="返回次元" name="backhome" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#ffffff; border:1 solid black" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#ffffff'">
            </td>
        </tr>
      </form></table>
    </td>
  </tr>
</table>
<br>
<br>
<center>
<font size=2>说明:<br>
为了节约空间和提高速度,请使用JPG或者GIF格式.(推荐使用JPG)<br>
图象质量在65左右比较合适.</font><br>
</center>
<table width=635 border=0 align="center">
  <tbody> 
  <tr> 
    <td> 
          <center>
        本论坛由<a href="mailto:clock123@163.net">旅行</a>制作| &copy; 2001<br>
            <table width="146" border="0" cellspacing="0" cellpadding="1" height="17" bgcolor="#CCCCCC">
              <tr>
                <td>
                  <table width="144" border="0" cellspacing="0" cellpadding="0" bgcolor="000066">
                    <tr align="center"> 
                      <td width="34" bgcolor="#FFFFFF"><a href="http://phpiscool.yeah.net"><font color="ffcf60" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="34567c">PHP</font></b></font></a></td>
                      <td align="left" width="110" bgcolor="#9999CC">
                        <a href="http://phpiscool.yeah.net"><font face="Verdana" color="#FFFFFF">&nbsp;is </font></font><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif"><b>Cool</b> 
                          </font><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">.yeah.net</font></a>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <script>document.write("<a href=http://www.textclick.com/viewmain.asp?name=simpletrip target=_blank><img src=http://ad.t2t2.com/stat.asp?user=simpletrip&refer="+escape(document.referrer)+"&cur="+escape(document.URL)+" border=0></a>");</script>
      </center>
    </td>
        <td align=right width=236><font face="Verdana" color="#111166">Powered 
          by <a style="color:333366" href="http://phpiscool.yeah.net"><b>Pic Dimension</b></a></font><a href="http://phpiscool.yeah.net"><b> 
          </b></a><br>
          <a href="http://phpiscool.yeah.net"><img src="images/phpiscool.gif" border=0 width="100" height="30"></a><br>
          <font face="Verdana" color="#111166">Something Really Cool</font>
        </TD>
  </tr>
  </tbody> 
</table>
</body>
</html>
<? exit; }
setcookie("pcduserid",$username,time()+1800);
setcookie("pcduserpwd",$password,time()+1800);
$spaceused=$spaceused+$file_upload_size;
$userpicno++;
$putstring="$id|$username|$useremail|$userpicno|$password|$spaceused|\n";
$fp=fopen("user/$user_file","w");
flock($fp,3);
fputs($fp,$putstring);
for ($i=0; $i<$count; $i++) {
if ($i!=$mark) fputs($fp,$user_list[$i]);
}
fclose($fp);
$al_list=file("user/$id/albumlist.php");
$count=count($al_list);
$fp=fopen("user/$id/albumlist.php","w");
flock($fp,3);
for ($i=0; $i<$count; $i++) {
$al_detail=explode("|",$al_list[$i]);
if ($al_detail[0]==$albumid) {
$al_detail[3]++;
$al_list[$i]="$al_detail[0]|$al_detail[1]|$al_detail[2]|$al_detail[3]|\n";
}
fputs($fp,$al_list[$i]);
}
fclose($fp);
if (file_exists("user/$id/$albumid/piclist.php")) $p_list=file("user/$id/$albumid/piclist.php");
$des=str_replace("\n","<br>",$des);
$des=str_replace("\r","<br>",$des);

$putstring="$file_upload_name|$des|\n";
$fp=fopen("user/$id/$albumid/piclist.php","w");
flock($fp,3);
fputs($fp,$putstring);
if (!empty($p_list)) {
$count=count($p_list);
for ($i=0; $i<$count; $i++) {
fputs($fp,$p_list[$i]);
}
}
copy($file_upload,"user/$id/$albumid/$file_upload_name");
?>
<html>
<head>
<title>上传成功</title>
<meta HTTP-EQUIV=REFRESH CONTENT="1;URL=<? echo "upload.php?id=$id&albumid=$albumid"; ?>">
</head>
<body bgcolor="<? echo $bg_color; ?>">
<br><br><br><br><br><br><br><br>
<center>---------<b><a href="<? echo "upload.php?id=$id&albumid=$albumid"; ?>"><font size=2 color=#336699>上传成功:图画已经上传</font></a></b>-------------</center>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -