# Sendmsg. php
<? Php
Require "func. php ";
If ($ b1 ){
If (is_user_exits ($ fromname) and check_user_password ($ fromname, $ password )){
Sendmsg ();
Echo "successful! <Br> <form method = "POST"> <input type = "button" value = "Close window" name = "B1" onclick = "window. close () "> </form> ";
}
Else {
$ Founderr = 1;
Echo "Incorrect username/password! ";
}
}
Else {
?>
<Html>
<Head>
<Title> send a message </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Link rel = "stylesheet" type = "text/css" href = "css/index.css">
</Head>
<Body bgcolor = "# eeeeee">
<Form method = "post" action = "<? Php echo $ php_self;?> ">
<Table width = "98%" border = "1" cellspacing = "0" cellpadding = "0" bordercolorlight = "#000000" bordercolordark = "# FFFFFF">
<Tr align = "center">
<Td colspan = "2"> to <a href = "userinfo. php? Name = <? Php echo $ name;?> "Target =" _ blank "> <? Php echo $ name;?> </A>
Send message </td>
</Tr>
<Tr>
<Td align = "right" width = "27%"> your Username: </td>
& Lt; td width = "73%" & gt;
<Input type = "text" name = "fromname" size = "17" maxlength = "16" value = "<? Php echo $ jl_forum [name];?> ">
* </Td>
</Tr>
<Tr>
<Td align = "right" width = "27%"> password: </td>
& Lt; td width = "73%" & gt;
<Input type = "password" name = "password" size = "17" maxlength = "16">
* </Td>
</Tr>
<Tr>
<Td align = "right" width = "27%" valign = "top"> content: </td>
& Lt; td width = "73%" & gt;
<Textarea name = "cont" wrap = "VIRTUAL" cols = "40" rows = "3"> </textarea>
<Input type = "hidden" name = "toname" value = "<? Php echo $ name;?> ">
<Br>
<Input type = "submit" name = "b1" value = "send">
<Input type = "button" name = "Submit" value = "cancel" onclick = "window. close ()">
</Td>
</Tr>
</Table>
</Form>
</Body>
</Html>
<? Php
}
?>
###############
# Setup. php
# This is the initialization program. It is only executed for the first time after the upload and must be deleted to avoid errors.
#################
<? Php
Require "func. php ";
Echo "Echo "establish database connection... OK! <Br> ";
Echo "create table boardinfo ...";
$ SQL = "CREATE TABLE boardinfo (name varchar (50) NOT NULL, chinesename varchar (50) NOT NULL )";
Mysql_query ($ SQL) or die ("error ");
Echo "OK! <Br> ";
Echo "create table user ...";
$ SQL = "CREATE TABLE user (id int (11) NOT NULL auto_increment, name varchar (50) NOT NULL, sex varchar (6), realname varchar (20 ), password varchar (16) not null, address varchar (40), oicq varchar (10), homepage varchar (50), score int (11), phone varchar (20 ), email varchar (50), regtime varchar (20), qm text, slaveboard varchar (50), primary key (id ))";
Mysql_query ($ SQL) or die ("error ");
Echo "OK! <Br> ";
Echo "create table message ...";
$ SQL = "create table message (id int (11) NOT NULL auto_increment, name varchar (50), fromname varchar (50), writetime varchar (20), cont longtext, primary key (id ))";
Mysql_query ($ SQL) or die ("error ");
Echo "OK! <Br> ";
Echo "initialize the layout" Personal Computer "...";
Create_board_table ('computer ', 'pc ');
Echo "OK! <Br> ";
Echo "Echo "<br> Computer Madman )";
?>
# Userinfo. php
<Html>
<Head>
<Title> User Information </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Link rel = "stylesheet" type = "text/css" href = "css/index.css">
</Head>
<Body bgcolor = "# FFFFFF" background = "image/bg.gif">
<? Php include "header. php ";
If (! Isset ($ name )){
?>
<Form method = "post" action = "<? Php echo $ php_self;?> ">
<Table width = "90%" border = "1" cellspacing = "0" cellpadding = "1" align = "center" bordercolorlight = "# cccccccc" bordercolordark = "# FFFFFF">
<Tr align = "center">
<Td> enter the user name to view </td>
</Tr>
<Tr align = "center">
<Td>
<Input type = "text" name = "name" size = "18" maxlength = "16">
</Td>
</Tr>
<Tr align = "center">
<Td>
<Input type = "submit" name = "b1" value = "View data">
</Td>
</Tr>
</Table>
</Form>
<? Php
}
Else {
Require "func. php ";
If (is_user_exits ($ name )){
$ SQL = "select * from user where name = '$ name '";
$ SQL _result = mysql_query ($ SQL );
$ Row = mysql_fetch_array ($ SQL _result );
?>
<Br>
<Table width = "90%" border = "1" cellspacing = "0" cellpadding = "1" align = "center" bordercolorlight = "# cccccccc" bordercolordark = "# FFFFFF">
<Tr>
<Td> <B> details </B> </td>
</Tr>
<Tr>
<Td> User name: <? Php echo $ row [name];?> </Td>
</Tr>
<Tr>
<Td> real name: <? Php echo $ row [realname];?> </Td>
</Tr>
<Tr>
<Td> Gender: <? Php echo $ row [sex];?> </Td>
</Tr>
<Tr>
<Td> address: <? Php echo $ row [address];?> </Td>
</Tr>
<Tr>
<Td> Tel: <? Php echo $ row [phone];?> </Td>
</Tr>
<Tr>
<Td> OICQ: <? Php echo $ row [oicq];?> </Td>
</Tr>
<Tr>
<Td> Email: <a href = "mailto: <? Php echo $ row [email];?> "> <? Php echo $ row [email];?> </A> </td>
</Tr>
<Tr>
<Td> Home Page: <a href = "<? Php echo $ row [homepage];?> "Target =" _ blank "> <? Php echo $ row [homepage];?> </A> </td>
</Tr>
<Tr>
<Td> Registration Time: <? Php echo $ row [regtime];?> </Td>
</Tr>
<Tr>
<Td> current points: <? Php echo $ row [score];?> </Td>
</Tr>
</Table>
<Br>
<? Php
}
Else {
Echo "enter the correct and valid user name ";
}
}
Include "footer. php";?>
</Body>
</Html>
# Viewmsg. php
<? Php
Require "func. php ";
If (is_user_exits ($ jl_forum [name]) and check_user_password ($ jl_forum [name], $ jl_forum [password]) {
If (isset ($ job )){
If (is_this_user ($ id )){
Delmsg ($ id );
}
}
$ Name = $ jl_forum [name];
$ SQL = "select * from message where name = '$ name '";
$ SQL _result = mysql_query ($ SQL );
$ Sum = mysql_num_rows ($ SQL _result );
?>
<Html>
<Head>
<Title> View comments </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Link rel = "stylesheet" type = "text/css" href = "css/index.css">
<Script language = "javascript">
Function sendmsg (name) {window. open ("sendmsg. php? Name = "+ name," "," height = 200, width = 500, resizable = yes, scrollbars = yes, status = no, toolbar = no, menubar = no, location = no ");
}
</Script>
</Head>
<Body bgcolor = "# FFFFFF" background = "image/bg.gif">
<P> you have <B> <? Php echo $ sum;?> </B> messages </p>
<Table width = "98%" border = "1" cellspacing = "0" cellpadding = "0" bordercolorlight = "# cccccccc" bordercolordark = "# FFFFFF">
<? Php
While ($ SQL _row = mysql_fetch_array ($ SQL _result )){
?>
<Tr bgcolor = "# eeeeee">
<Td> <a href = "javascript: sendmsg ('<? Php echo $ SQL _row [fromname];?> ') "> <? Php echo $ SQL _row [fromname];?> </A>
On <? Php echo $ SQL _row [writetime];?> <A href = "<? Php echo "$ php_self? Job = del & id = $ SQL _row [id] ";?> "> Delete </a> </td>
</Tr>
<Tr>
<Td> <? Php echo $ SQL _row [cont];?> </Td>
</Tr>
<Tr>
<Td> </td>
</Tr>
<? Php
}
?>
</Table>
<P> </p>
</Body>
</Html>
<? Php
}
Else {
Show_error (4 );
}
?>