Support for oicq headers (2)
Last Update:2018-12-08
Source: Internet
Author: User
Addnote. php
<HTML>
<HEAD>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<TITLE> Add a message </TITLE>
<Style type = "text/css">
<! --
. White12 {font-size: 12pt; color: # FFFFFF; text-decoration: none}
-->
</Style>
</HEAD>
<Body bgcolor = "# FFFFFF">
<Table width = "98%" border = "0" cellspacing = "0" cellpadding = "0" height = "61">
<Tr>
<Td height = "62" width = "34%"> <a href = "http://www.medguider.com"> </a> </td>
& Lt; td height = "62" width = "66%" & gt;
<Div align = "center"> </div>
</Td>
</Tr>
</Table>
<? Php
Include ("config. php ");
If ($ submit ){
$ Time = date ("Y, m, D, H: I: s ");
$ Ip = $ REMOTE_ADDR; // the ip address of the contact.
$ Name = trim ($ name );
$ Email = trim ($ email );
$ Title = strip_tags ($ top );
$ Nnote = nl2br (strip_tags ($ content); // remove the html Tag and convert the linefeed to <br>.
If (! $ Name |! $ Email |! $ Title |! $ Nnote) {// check whether it is complete
Echo "Sorry, you must fill in all content! <BR> "." <a href = 'javascript: history. back () '> return </a> ";
Exit;} elseif (! Ereg ('^ [-! # $ % & '* +./0-9 =? A-Z ^ _ 'a-z {|} ~] + '.'@'.'[-! # $ % & '* + \/0-9 =? A-Z ^ _ 'a-z {|} ~] + .'.'[-! # $ % & '* + \./0-9 =? A-Z ^ _ 'a-z {|} ~] + $ ', $ Email) // verify email Validity
){
Echo "email is invalid! <BR> "." <a href = 'javascript: history. back () '> return </a> ";
Exit;
}
// Write data to the database
$ SQL = "INSERT INTO notebook (name, email, time, face, ip, title, nnote) VALUES ('$ name',' $ email ',' $ time ', '$ face',' $ ip', '$ title',' $ nnote ')";
$ Result = mysql_query ($ SQL, $ db );
Mysql_close ($ db );
Echo "message successful! ";
}
?>
<Table width = "99%" border = "1" cellspacing = "0" cellpadding = "0" align = "center" bordercolor = "# 3366FF">
<Tr bgcolor = "# 3366FF">
<Td width = "81%" class = "white12" height = "26"> <a href = ".. /index. php "class =" white12 "> homepage </a>
> <A href = "index. php" class = "white12"> guestbook </a>
> Add a message </td>
<Td width = "19%" class = "white12" height = "26"> <a href = 'index. php' class = "white12"> View comments </a>
</Td>
</Tr>
<Tr>
<Td colspan = "2">
<Form name = "form1" method = "post" action = "addnote. php">
<Table width = "99%" border = "0" cellspacing = "0" cellpadding = "0">
<Tr>
<Td width = "54%"> </td>
<Td rowspan = "2" width = "46%"> select an avatar you like: <br>
<Input type = "radio" name = "face" value = "1" checked>
<Input type = "radio" name = "face" value = "2">
<Input type = "radio" name = "face" value = "3">
<Input type = "radio" name = "face" value = "4">
<Input type = "radio" name = "face" value = "5">
<Input type = "radio" name = "face" value = "6">
<Input type = "radio" name = "face" value = "7">
<Input type = "radio" name = "face" value = "8">
<Input type = "radio" name = "face" value = "9">
<Input type = "radio" name = "face" value = "10">
<Input type = "radio" name = "face" value = "11">
<Input type = "radio" name = "face" value = "12">
<Input type = "radio" name = "face" value = "13">
<Input type = "radio" name = "face" value = "14">
<Input type = "radio" name = "face" value = "15">
<Input type = "radio" name = "face" value = "16">
<Input type = "radio" name = "face" value = "17">
<Input type = "radio" name = "face" value = "18">
<Input type = "radio" name = "face" value = "19">
<Input type = "radio" name = "face" value = "20">
<Input type = "radio" name = "face" value = "21">
<Input type = "radio" name = "face" value = "22">
<Input type = "radio" name = "face" value = "23">
<Input type = "radio" name = "face" value = "24">
<Input type = "radio" name = "face" value = "25">
<Input type = "radio" name = "face" value = "26">
<Input type = "radio" name = "face" value = "27">
<Input type = "radio" name = "face" value = "28">
<Input type = "radio" name = "face" value = "29">
<Input type = "radio" name = "face" value = "30">
<Input type = "radio" name = "face" value = "31">
<Input type = "radio" name = "face" value = "32">
<Input type = "radio" name = "face" value = "33">
<Input type = "radio" name = "face" value = "34">
<Input type = "radio" name = "face" value = "35">
<Input type = "radio" name = "face" value = "36">
<Input type = "radio" name = "face" value = "37">
<Input type = "radio" name = "face" value = "38">
<Input type = "radio" name = "face" value = "39">
<Input type = "radio" name = "face" value = "40">
<Input type = "radio" name = "face" value = "41">
<Input type = "radio" name = "face" value = "42">
<Input type = "radio" name = "face" value = "43">
<Input type = "radio" name = "face" value = "44">
<Input type = "radio" name = "face" value = "45">
<Input type = "radio" name = "face" value = "46">
<Input type = "radio" name = "face" value = "47">
<Input type = "radio" name = "face" value = "48">
<Input type = "radio" name = "face" value = "49">
<Input type = "radio" name = "face" value = "50">
<Input type = "radio" name = "face" value = "51">
<Input type = "radio" name = "face" value = "52">
<Input type = "radio" name = "face" value = "53">
<Input type = "radio" name = "face" value = "54">
<Input type = "radio" name = "face" value = "55">
<Input type = "radio" name = "face" value = "56">
<Input type = "radio" name = "face" value = "57">
<Input type = "radio" name = "face" value = "58">
<Input type = "radio" name = "face" value = "59">
<Input type = "radio" name = "face" value = "60">
<Input type = "radio" name = "face" value = "61">
<Input type = "radio" name = "face" value = "62">
<Input type = "radio" name = "face" value = "63">
<Input type = "radio" name = "face" value = "64">
</Td>
</Tr>
<Tr>
<Td width = "54%"> name
<Input type = "text" name = "name">
<Br>
Email
<Input type = "text" name = "email">
<Br>
Title
<Input type = "text" name = "top" size = "50">
<Br>
Content <br>
<Textarea name = "content" cols = "50" rows = "20"> </textarea>
</Td>
</Tr>
<Tr>
<Td colspan = "2">
<Div align = "center">
<Input type = "submit" name = "submit" value = "OK">
<Input type = "reset" name = "cancel" value = "Rewrite">
</Div>
</Td>
</Tr>
</Table>
</Form>
</Td>
</Tr>
</Table>
<P> <a href = "main. php? User = <? Echo $ user?> "Class =" white12 "> <br>
</A> </p>
</BODY>
</HTML>
Delnote. php
<? Php
Include ("config. php ");
If ($ superadmin) {// if you have logged on as an administrator, verify the password.
If (! ($ User = $ username) |! ($ Psw = $ password )){
Echo "Incorrect password ";
Exit;
}
} Else {// Administrator Login
Echo "<form name = 'form1' method = 'post' action = '$ PHP_SELF'> ";
Echo "<div align = 'center'> enter the administrator password <br> ";
Echo "Administrator ";
Echo "<input type = 'text' name = 'user'> <br> ";
Echo "password ";
Echo "<input type = 'Password' name = 'psw'> <br> ";
Echo "<input type = 'submit 'name = 'superadmin' value =' '> <br> ";
Echo "<input type = 'reset' name = 'cancel' value = 'overwrite'> </div> ";
Echo "</form> ";
Exit;
}
If ($ del = 1) {// determine whether to delete
Mysql_query ("delete from notebook where time = '$ time'", $ db); // use the message time as the delete flag
Echo "deleted successfully! ";
}
?>
<HTML>
<HEAD>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<TITLE> delete a message </TITLE>
<Style type = "text/css">
<! --
. Blue9 {font-size: 9pt; color: # 0099FF; text-decoration: none}
. Black9 {font-size: 9pt; text-decoration: none}
. Purple10 {font-size: 10pt; color: # 9900FF; text-decoration: none}
. White12 {font-size: 12pt; color: # FFFFFF; text-decoration: none}
A: visited {color: # FFFFFF}
A: link {color: # FFFFFF}
-->
</Style>
</HEAD>
<Body bgcolor = "# FFFFFF">
<? Php
$ Result = mysql_query ("SELECT * FROM notebook", $ db );
$ Row = mysql_num_rows ($ result); // check the number of rows in the result.
$ Max = $ row; // Total number of posts
// Set 10 entries per page, total number of pages of $ p, number of pages of $ page, starting with the row where $ low reads, and number of rows read by $ x
If (! $ Page) {$ page = 1 ;}
$ P = ceil ($ max/10 );
$ Low = 10 * ($ page-1 );
If ($ page = $ p & ($ max % 10) <> 0) {$ x = ($ max % 10);} else {$ x = 10 ;} // if the last page is not an integer multiple of 10, read the remainder of $ max divided by 10. Otherwise, take 10.
If ($ max = 0) {$ x = 0;} // if there is no post, set $ x to 0.
$ Result = mysql_query ("select * from notebook order by time DESC limit $ low, $ x", $ db );
?>
<Table width = "98%" border = "0" cellspacing = "0" cellpadding = "0" height = "61">
<Tr>
<Td height = "62" width = "34%"> <a href = "http://www.medguider.com"> </a> </td>
& Lt; td height = "62" width = "66%" & gt;
<Div align = "center"> </div>
</Td>
</Tr>
</Table>
<Table width = "95%" border = "1" cellspacing = "0" cellpadding = "0" height = "253" bordercolordark = "# FFFFFF" bordercolorlight = "#003399" align = "center">
<Tr>
& Lt; td height = "250" & gt;
<Table width = "95%" border = "0" cellspacing = "0" cellpadding = "0" height = "32" bgcolor = "# 3366FF">
<Tr>
<Td width = "28%" class = "white12"> Homepage
> <A href = "index. php" class = "white12"> guestbook </a> </td>
<Td width = "56%" class = "white12">
<? Php
Echo "Total number of posts:", $ max, "No ";
For ($ n = 1; $ n <= $ p; $ n ++ ){
Echo "<a href = index. php? Page = $ n> $ n </a> ";
}
Echo "page ";
?>
</Td>
<Td width = "16%"> <a href = "index. php" class = "white12"> View comments </a> </td>
</Tr>
</Table>
<? Php
For ($ I = 0; $ I <= ($ x-1); $ I ++ ){
$ Email = mysql_result ($ result, $ I, 'email ');
$ Face = mysql_result ($ result, $ I, 'face ');
$ Face = 'image/face/icon '. $ face;
$ Name = mysql_result ($ result, $ I, 'name ');
$ Time = mysql_result ($ result, $ I, 'time ');
$ Ip = mysql_result ($ result, $ I, 'IP ');
$ Title = mysql_result ($ result, $ I, 'title ');
$ Nnote = mysql_result ($ result, $ I, 'note ');
Echo "<table width = '000000' border = '0' cellspacing = '0' cellpadding = '0' height = 100% 'bordercolor = '# ffff'> <tr bgcolor =' # eeeeee '> ";
Echo "<td width = '000000' height = '33' bgcolor = '# eeeeee' class = 'blue9'> </td> ";
Echo "<td width = '000000' height = '33' bgcolor = '# eeeeee' class = 'blue9'> contact: $ name </td> ";
Echo "<td width = '000000' height = '33' bgcolor = '# eeeeee' class = 'blue9'> published at: $ time </td> ";
Echo "<td width = '000000' height = '33' bgcolor = '# eeeeeee' class = 'blue9'> <a href = 'mailto: $ email '> </a> </td> ";
Echo "<td width = '000000' height = '33' class = 'blue9'> $ ip <a href = '$ PHP_SELF? Del = 1 & time = $ time & superadmin = $ superadmin & user = $ user & psw = $ psw'> </a> </td> </tr> <tr> ";
Echo "<td colspan = '5' class = 'purple10' height = '33'> title: $ title </td> </tr> ";
Echo "<tr bgcolor = '# ffff'> <td colspan = '5' class = 'black9' height = '37'> message content: $ nnote </td> </tr> </table> ";
}
Mysql_close ($ db );
?>
</Td>
</Tr>
</Table>
</BODY>
</HTML>