制作公告栏
代码如下:
File #1 : mybb.php 
<HTML><HEAD> <title> Bulletin Board </title> 
<HEAD> 
<BODY><? 
/* 
Thanks to <[email protected]
who has motivated me to develop on this. 
You are welcome to use and develop on this. 
written and proofed by Vijay Sarvepalli <[email protected]

*/ 
if ($message

/* uncomment the next two lines to strip out html from input */ 
/* $name = strip_tags($name); */ 
/* $message = strip_tags($message); */ 
$message ereg_replace("rnrn""n<P>"$message); 
$date date("l, F j Y, h:i a"); 
mt_srand((double)microtime()*1000000); 
$rndnum mt_rand(9,9000000); 
$message "<center> <b> Topic: $subject </b> </center> <table border=1> <tr> <td> <B>$subject from $name </B> -- $date </tr> </td> <tr> <td><P> $message </td> </tr> "
$message .= " <tr> <td> e-mail contact $email </td> </tr> </table> <small> <small> $REMOTE_ADDR </small> </small> <HR>rn"
$sp "bulletin-board.php"
$fp $rndnum.".php"
if ( !
copy($sp$fp)) { 
print (
"Operation failed"); } 
$fp fopen($fp.".comment","a"); 
fwrite ($fp$message); 
fclose ($fp); 
$reference "<table border=1 > <tr> <td> <A Href='".$rndnum.".php'>Message from $name on $date <br></a> <b> Subject $subject </b> </td></tr> </table> <hr> rn "
$rp fopen(basename($PHP_SELF).".reference","a"); 
fwrite ($rp,$reference); 
fclose($rp); 

print (
"<b> Previous Message on this bulletin board: </b><br><small> <small> Click on hyperlink to view message and reply </small> </small> "); 
@
readfile(basename(($PHP_SELF ".reference"))); 
?> 
<FORM method="post"> 
<b> Post a New Topic for discussion </b> <br> 
<small> <small> (Please give accurate information, do not abuse this bulletin board)</small> </small> <br> 
<b>Your name:</b><BR><INPUT name="name" type="text" size="55"><BR> 
<b>Your e-mail address:</b><BR><INPUT name="email" type="text" size="55"><BR> 
<b>Title for your discussion:</b><BR><INPUT name="subject" type="text" size="55"><BR> 
<b>Your comment:</b><BR><TEXTAREA name="message" rows=10 cols=55 wrap=virtual> 
</TEXTAREA><BR> 
<INPUT name="submit" type="submit" value="Post a new Topic"> 
</FORM> 

</BODY></HTML> 

-------------------------------CUT HERE ---------------------------------- 



File #2: bulletin-board.php 

<HTML><HEAD> <title> Bulletin Board </title> 
<HEAD> 
<BODY><? 
/* 

Who wouldnt like this one without a need for mysql 
Thanks to <[email protected]
who has motivated me to develop on this. 
You are welcome to use and develop on this. 
written and proofed by Vijay Sarvepalli <[email protected]

*/ 
if ($message

/* uncomment the next two lines to strip out html from input */ 
/* $name = strip_tags($name); */ 
/* $message = strip_tags($message); */ 
$message ereg_replace("rnrn""n<P>"$message); 
$date date("l, F j Y, h:i a"); 
$rndnum mt_rand(); 
// $message = "<B>$name </B> -- $date<P> $message <BR><HR>"; 

$message "<table border=1> <tr> <td> <B>Reply from $name </B> -- $date </tr> </td> <tr> <td><P> $message </td> </tr> "
$message .= " <tr> <td> e-mail contact $email </td> </tr> </table> <small> <small> $REMOTE_ADDR </small> </small> <HR>rn"

$fp fopen (basename($PHP_SELF) . ".comment""a"); 
fwrite ($fp$message); 
fclose ($fp); 

@
readfile(basename(($PHP_SELF ".comment"))); 
?> 
<b> Post your reply to this topic: </b> <br> 
<FORM method="post"> 
<b>Your name:</b><BR><INPUT name="name" type="text" size="55"><BR> 
<b>Your e-mail address:</b><BR><INPUT name="email" type="text" size="55"><BR> 
<b>Your response:</b><BR><TEXTAREA name="message" rows=10 cols=55 wrap=virtual> 
</TEXTAREA><BR> 
<INPUT name="submit" type="submit" value="Post reply to this topic"> 
</FORM> 
</BODY></HTML>