程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> 我的論壇源代碼(十)

我的論壇源代碼(十)

編輯:關於PHP編程

reguse.inc.php處理注冊用戶時的信息

<?

function regok($mess,$reginfo)       //記錄成功後輸出用戶信息
{
echo "<table width='70%' border='0' cellspacing='0' cellpadding='0' bgcolor='#000000' align='center'>";
echo "<tr><td><table width='100%' border='0' cellspacing='1' cellpadding='1' align='center' bgcolor='#eeeeee'><tr bgcolor='#006699'><td colspan='4'><div align='center'><font color='ffffff'>".$mess."</font></div></td></tr>";
echo "<tr ><td width='15%' ><div align='left'>ID號:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[13]."</font></div></td>";
echo "<td width='15%'><div align='left'>用戶:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[0]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>密碼:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[1]."</font></div></td>";
echo "<td width='15%'><div align='left'>主頁:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[9]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>郵箱:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[8]."</font></div></td>";
echo "<td width='15%'><div align='left'>oicq:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[3]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>昵稱:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[2]."</font></div></td>";
echo "<td width='15%'><div align='left'>等級:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[11]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>性別:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[4]."</font></div></td>";
echo "<td width='15%'><div align='left'>年齡:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[5]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>職業:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[6]."</font></div></td>";
echo "<td width='15%'><div align='left'>來自:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[7]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>信息保密:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[12]."</font></div></td>";
echo "<td width='15%'><div align='left'>簽名:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[10]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>郵件通知:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[18]."</font></div></td>";
echo "<td width='15%'><div align='left'>注冊時間:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[15]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>登錄時間:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[16]."</font></div></td>";
echo "<td width='15%'><div align='left'>頭像:</div></td><td width='35%' ><div align='center'><img src='images/".$reginfo[14].".gif'></div></td></tr>";
$reginfo=$reginfo[0];
echo "<tr bgcolor='#006699'><td colspan='4'><div align='center'><a href='reguse.php?action=dl&use=".$reginfo."'>用戶登錄</a></div></td></tr>";
echo "</table></td></tr></table>";


}



     //檢查信息並寫入記錄
function reg($usename,$usepass,$usemail,$useweb,$useni,$useoicq,$usesex,$useage,$usezy,$useaddr,$useinf,$usety,$usebq,$useqm)
{
  if ($usename)     //如果有用戶名傳入則處理   用戶注冊模塊
    {
      if(strlen($usename)>8) return 1;
      else if(strlen($usepass)>8) return 2;
      else if(strlen($useoicq)>12) return 3;
      else if(!uinfo($usepass,pass)) return 4;
      else if(!uinfo($usename,name)) return 5;
      else if(!uinfo($useoicq,oicq)) return 6;
      else if(!uinfo($usemail,mail)) return 7;
      else
        {
          if(!$useinf) $useinf=2;
          $query="select * from useinfo where usename='".$usename."'";  //是否已經存在用戶
          $req=mysql_query($query);
          $useinfp=mysql_fetch_array($req);
          if ($useinfp[0]) return 8;
          else
            {
              $time=date(Y年n月j日G時i分);
              $useqm=nl2br($useqm);                                                                            //寫入用戶信息
              $query="insert into useinfo (usename,usepass,usemail,useweb,useni,useoicq,usesex,useage,usezy,useaddr,useinf,usety,usebq,useqm,useattr,regdate,enddate) values ('".$usename."','".$usepass."','".$usemail."','".$useweb."','".$useni."','".$useoicq."','".$usesex."','".$useage."','".$usezy."','".$useaddr."','".$useinf."','".$usety."','".$usebq."','".$useqm."',1,now(),'".$time."')";
              $req=mysql_query($query);
              if ($req)
                 {
                 $query="select * from useinfo where usename='".$usename."'";  //取出用戶信息,並傳出用戶端
                 $req=mysql_query($query);
                 $useinfo=mysql_fetch_array($req);
                 return $useinfo;
                 }
              else return 10;
            }
        }
        return 9;
    }
}

function usemess($mess,$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm)      //信息輸入表單
{
echo "<FORM METHOD=post>";
echo "<table width='90%' border='0' cellspacing='0' cellpadding='0' bgcolor='#000000' align='center'>";
echo "<tr><td><table width='100%' border='0' cellspacing='1' cellpadding='1' align='center'>";
echo "<tr bgcolor='#006699'><td colspan='2'><font color='ffffff'><div align='center'>狐網論壇用戶注冊---<font color='00ff00'>".$mess."</font></div></font></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'> 用 戶 名:<font color='#FF0000'>八位,第一位必須是字母</FONT></div></td><td width='52%'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='usename' size='30' maxlength='8' value='".$usename."'></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>密  碼:<font color='#FF0000'>八位,數字和字母組合.</font></div></td><td width='52%'><input style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='password' name='usepass' size='30' maxlength='8'></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>電子信箱:<font color='#FF0000'>請填寫真實的郵箱地址。</font></div></td><td width='52%'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='usemail' size='50' maxlength='50' value='".$usemail."'></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>個人主頁:</div></td><td width='52%'><div align='left'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='useweb' size='50' maxlength='50' value='".$useweb."'></div></td></tr>";
echo "<tr bgcolor='#006699'><td colspan='2'><div align='center'><font color='#FFFFFF'>個人信息設定</font></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>你的昵稱:</div></td><td width='52%'><div align='left'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='useni' size='30' maxlength='15' value='".$useni."'></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>OICQ:</div></td><td width='52%'><div align='left'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='useoicq' size='20' maxlength='20' value='".$useoicq."'></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>性  別:</div></td><td width='52%'><div align='left'><select onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' name='usesex'><option value='1' selected>我是男生</option><option value='0'>我是女生</option></select></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>年  齡:</div></td><td width='52%'><div align='left'><select onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' name='useage'><option value='14'>15歲以下</option><option value='15'>15 歲</option><option value='16'>16 歲</option><option value='17'>17 歲</option>";
echo "<option value='18'>18 歲</option><option value='19'>19 歲</option><option value='20' selected>20 歲</option><option value='21'>21 歲</option><option value='22'>22 歲</option><option value='23'>23 歲</option><option value='24'>24 歲</option><option value='25'>25 歲</option><option value='26'>26 歲</option><option value='27'>27 歲</option><option value='28'>28 歲</option><option value='29'>29 歲</option><option value='30'>30或以上</option></select></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>職  業:</div></td><td width='52%'><div align='left'><select onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' name='usezy'><option value='5' selected>我是學生</option><option value='1'>公務員</option><option value='2'>公司雇員</option><option value='3'>自由職業</option><option value='4'>無所事事</option><option value='5'>不告訴你</option></select></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>來自何方:</div></td><td width='52%'><div align='left'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='useaddr' size='50' maxlength='50' value='".$useaddr."'></div></td></tr>";
echo "<tr bgcolor='#006699'><td colspan='2'><div align='left'></div><div align='center'><font color='#FFFFFF'>參數設定</font></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>是否充許他人查看你的信息:</div></td><td width='52%'><div align='left'><input type='radio' name='useinf' value='2'>否  <input type='radio' name='useinf2' value='1' checked>是</div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%' valign='top'><div align='left'>個人簽名檔:</div></td><td width='52%'><div align='left'><textarea onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' name='useqm' cols='40' wrap='VIRTUAL' rows='5'>".$useqm."</textarea></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'>是否允許版主或管理員給你發郵件通知:</div></td><td width='52%'><div align='left'><input type='radio' name='usety' value='2'>否  <input type='radio' name='usee2' value='1' checked>是</div></td></tr>";
echo "<tr bgcolor='#006699'><td colspan='2'><div align='center'><font color='#FFFFFF'>頭像設定</font></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td colspan='2'><div align='center'><input type='radio' name='bq[0]' value='a'><img src='images/a.gif' width='15' height='15' checked>  <input type='radio' name='bq[1]' value='1'><img src='images/1.gif' width='15' height='15'>  <input type='radio' name='bq[2]' value='2'><img src='images/2.gif' width='15' height='15'>  <input type='radio' name='bq[3]' value='3'><img src='images/3.gif' width='15' height='15'>  <input type='radio' name='ba[4]' value='4'><img src='images/4.gif' width='15' height='15'>  ";
echo "<input type='radio' name='bq[5]' value='5'><img src='images/5.gif' width='15' height='15'>  <input type='radio' name='bq[6]' value='6'><img src='images/6.gif' width='15' height='15'>  <input type='radio' name='ba7' value='[7]'><img src='images/7.gif' width='15' height='15'>  <input type='radio' name='ba[8]' value='8'><img src='images/8.gif' width='15' height='15'>  <input type='radio' name='ba[9]' value='9'><img src='images/9.gif' width='15' height='15'></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td colspan='2'></td></tr>";
echo "</table></td></tr></table>";
echo "<div align='center'><INPUT TYPE='HIDDEN' NAME='action' VALUE='add'><INPUT class='bott' TYPE='SUBMIT' name='submit' VALUE='提 交!'><INPUT class=bott TYPE='RESET' NAME='Reset' VALUE='重 填'></form></div>";
}
function dlmes($mess)
{
echo "<table width='50%' border='0' cellspacing='0' cellpadding='0' bgcolor='#000000' align='center'>";
echo "<tr><td>";
echo "<table width='100%' border='0' cellspacing='1' cellpadding='1' bgcolor='#eeeeee'><form method='post'>";
echo "<tr bgcolor='#009999'><td><div align='center'><font color='#FFFFFF'>".$mess."</font></div></td></tr>";
echo "<tr><td><div align='center'>用戶名:<input type='text' name='uname'></div></td></tr>";
echo "<tr><td><div align='center'>密 碼:<input type='password' name='upass'></div></td></tr>";
echo "<tr><td><div align='center'><input type='submit' name='Submit' value='確定'></div></td></tr>";
echo "<tr><td><input type='hidden' name='action' value='dl'></td></tr>";
echo "<tr><td><div align='center'><a href='useinfo.php?action=pass'>[忘記密碼]</a>     <a href='reguse.php?action=xy'>[我要注冊]</a></div></td></tr>";
echo "<tr bgcolor='#009999'><td height='20'></td></tr>";
echo "</form></table></td></tr></table>";
}
?> 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved