MySQL based forum (1) _php Foundation

Source: Internet
Author: User
###############################################
This article is original, if there are references, please indicate the author information.
Author: Cold Love Madman
Email:edincur@yeah.net
Http://safebase.yeah.net
###############################################
# # adduser.php ################################
###############################################
<?php
Require ("func.php");
if (empty ($name) or empty ($pwd 1)) {
Show_error (2);
$founderr = 1;
}
if (Is_user_exits ($name)) {
Show_error (3);
$founderr = 1;
}
if ($pwd 1<> $pwd 2) {
Show_error (5);
$founderr = 1;
}
if (strlen ($name) >16 or strlen ($pwd 1) >16 or strlen ($QM) >255) {
Show_error (6);
$founderr = 1;
}
$password = $pwd 1;
if (! $founderr) {
AddUser ();
echo "Success!"
}

?>
######################
### admin.php ########
######################
<?php
Require "func.php";
if (Adminok ()) {
?>
<title> Management </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<link rel= "stylesheet" type= "Text/css" href= "Css/index.css" >

<body bgcolor= "#FFFFFF" >
Please select the layout to operate <br>
<table width= "98%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
&LT;TD width= "52%" valign= "Top" >
<table width= "98%" border= "1" cellspacing= "0" cellpadding= "0" bordercolorlight= "#000000" bordercolordark= "#FFFFFF ">
&LT;TR align= "center" bgcolor= "#eeeeee" >
&LT;TD width= "42%" height= ">Chinesename</td>"
&LT;TD width= "33%" height= ">Name</td>"
</tr>
<?php
$sql = "SELECT * from Boardinfo";
$sql _result=mysql_query ($sql);
while ($sql _row=mysql_fetch_array ($sql _result)) {
?>
&LT;TR align= "center" >
&LT;TD width= "42%" ><a href= "admin.php?board=<?php echo $sql _row[name];? > "><?php echo $sql _row[chinesename];? ></a></td>
&LT;TD width= "33%" ><?php echo $sql _row[name];? ></td>
</tr>
<?php
}
?>
</table>
<br>
<form name= "FORM5" action= "oper.php" >
English Name:
<input type= "text" name= "name" size= "Maxlength=" >
<br>
Chinese name:
<input type= "text" name= "Chinesename" size= "maxlength=" >
<input type= "hidden" name= "Add_board" value= "Y" >
<br>
<input type= "Submit" Name= "Add_board" value= "Add Page" >
</form>
</td>
&LT;TD width= "48%" valign= "Top" >
<?php
if (Isset ($board)) {
$sql = "SELECT * from Boardinfo where name= ' $board '";
$sql _result=mysql_query ($sql);
$sql _row=mysql_fetch_array ($sql _result);
$name = $sql _row[name];
$chinesename = $sql _row[chinesename];
?>
<table width= "98%" border= "1" cellspacing= "0" cellpadding= "0" bordercolorlight= "#FFFFFF" bordercolordark= "#CCCCCC ">
<tr>
<td>
<form name= "Form1" action= "oper.php" >
Add Moderator:
<input type= "text" name= "name" size= "Maxlength=" >
<input type= "Submit" Name= "Add_admin" value= "Add" >
<input type= "hidden" name= "add_admin" value= "Y" >
<input type= "hidden" name= "board" value= "<?php echo" $board "?>" >
</form>
</td>
</tr>
<tr>
<td>
<form name= "Form2" action= "oper.php" >
Delete Moderator:
<select name= "Name" >
<?php
$sql = "SELECT name from user where slaveboard= ' $board '";
$sql _result=mysql_query ($sql);
while ($sql _row=mysql_fetch_array ($sql _result)) {
echo "<option value=\" $sql _row[name]\ "> $sql _row[name]</option>";
}
?>
</select>
<input type= "Submit" Name= "Delete_admin" value= "Delete" >
<input type= "hidden" name= "delete_admin" value= "Y" >
</form>
</td>
</tr>
<tr>
<td>
<form name= "form3" action= "oper.php" >
Chinese name
<input type= "text" name= "Chinesename" size= "" maxlength= "" "Value=" <?php echo "$chinesename"?> ">
<br>
English name
<input type= "text" name= "name" size= "maxlength=" "value=" "<?php echo" $name "?>" >
<input type= "hidden" name= "Modify" value= "Y" >
<input type= "Submit" name= "Modify" value= "Change" >
</form>
</td>
</tr>
<tr>
<td>
<form name= "FORM4" action= "oper.php" >
<input type= "Submit" Name= "Del_board" value= "Delete plate" >
<input type= "hidden" name= "board" value= "<?php echo" $board "?>" >
<input type= "hidden" name= "Del_board" value= "Y" >
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<?php
}
?>
</td>
</tr>
</table>
</body>
<?php
}
else {
Show_error (1);
}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.