The best message of the challenge of the source code (II)

Source: Internet
Author: User
Tags date exit insert mail php file reset strlen
post.php file
<?php
Require (' config.php ');
?>


<?php


$nikename = $arr _request[' nikename '];

if (strlen ($nikename) ==0)
{
echo "<center>";

echo "echo "Sorry, <font Color=red> said </font> must fill in!!! Please refill!<br> ";
echo "echo "free message book by <a href=http://little.oso.com.cn> Bear </a> provide technical support";
echo "</center>";
Exit;

}

$date _now=date (' y/m/d h:i:s ');
$ip _address=getenv ("remote_addr");
$messageold = $arr _request[' message '];
$pattern = "/n/";
$replacement = "<br>";

$message =computer_message ($messageold, $hang _zifu_number);

$subjectold = $arr _request[' subject '];
if (strlen ($subjectold) > $hang _zifu_number)

$subject =computer_message ($subjectold, $hang _zifu_number);
Else
$subject = $subjectold;

$str _sql= "INSERT into $table _name
(NIKENAME,SUBJECT,DATE_CREATED,IP_ADDRESS,MESSAGE,EMAIL_ADDRESS,ZHUYE_ADDRESS,OICQ)
Values
(' $nikename ',
' $subject ',
' $date _now ',
' $ip _address ',
' $message ',
'. $arr _request[' email_address '. "',
'. $arr _request[' zhuye_address '. "',
'. $arr _request[' Oicq ']. "'

)";

$result =mysql_db_query ($db _name, $str _sql, $id _link);

if (! $result) {
Affy_error_exit (' SQL Insert Execution has failed. ');
}

Else

{


echo "<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" > ";
echo "<HTML><HEAD><TITLE> publish article </TITLE>";
echo "<meta content=" text/html; charset=gb2312 "http-equiv=content-type>";
echo "<meta http-equiv=" REFRESH "content=" 2; Url=display.php ">";
echo "echo "<ul> Thank you for your message, will automatically display the message content";
echo "<br>";
echo "<a href=display.php> If your browser does not automatically return to the Guest Book home page,?
Please click here to return. ";
echo "</a></ul>";


Exit


}
?>

index.html file

<center>

<title> Thank you for your message! </title>
<font Color=navy> First of all thank you for your message, every word of yours I will read CAREFULLY!!! </font>

<form action= "post.php" method= "POST" >
<table>
<tr>
<td><font Color=teal> said: </font><font color=red> (cannot be empty) </font></td><td>
<input type= "text" name= "Nikename" "value=" "></td>
</tr>


<tr>
&LT;TD&GT;OICQ number:</td><td>

<input type= "text" name= "Oicq" "value=" "></td>
</tr>
<tr>
<td>e-mail: </td><td>
<input type= "text" name= "email_address" value= "" size= "></td>
</tr>
<tr>
<td> Personal Homepage:</td><td>
<input type= "text" name= "zhuye_address" value= "http://" size= "></td>"
</tr>
<tr><td>
Theme:</td><td>
<input type= "text" name= "subject" size= "></td>"
</tr>
<tr><td>
Content:</td><td> </td>
</tr>
&LT;TR&GT;&LT;TD colspan= "2" >
<textarea name= "message" cols= "rows=" 8 "></textarea></td>
</tr>
<tr>
<td>
<input type= "Submit" value= "complete Message" >
</td>
<td>
<input type= "reset" value= "reset" >
</td>
</tr>
</table>
</form>
<p>
<a href=display.php> View Message </a>
Free Message book by <a href= "http://little.oso.com.cn" > Cubs </a> Provide technical support

</center>


DISPLAY.INC file!!!


<tr bgcolor=>
<td>
<a href=mailto:<?php echo $record->email_address?> >
<font color= "Blue" size=4><strong><?php echo $record->nikename?></strong></font>
</a>
</td>
<td><font color= "Navy" > Message time: <?php echo $record->date_created?></font></td>

<td> from:

<?php
$ip _address=ip_question ($record->ip_address);
echo $ip _address;
?>

</td>
</tr>
<tr bgcolor=>
<th colspan=3 align=left> Theme: <font color=teal><?php echo $record->subject? ></font></th >

</tr>

<tr><th colspan=3 align=left><font color= "#416AAF" >
<?php Echo $record->message?></font></th>
</tr>


<?php

if ($record->huifu_biaozi)
{
?>
<tr><th colspan=3 align=left><font color= "Red" ><br><br> Moderator reply: </font><font Color= "Navy" >
<?php Echo $record->huifu?></font></th>
</tr>
<?php

}

?>



<tr>
<th colspan=3 align=left><br>
<a href=mailto:<?php echo $record->email_address?> >
alt= "<?php Echo $record->nikename?> e-mail address is: <?php echo $record->email_address?>"
Border= "0" width= "length=" > Mail </a>
<a href=<?php echo $record->zhuye_address? >>alt= "<?php Echo $record->nikename?> 's home address is: <?php echo $record->zhuye_address?>"
Border= "0"
Width= "length=" > Homepage </a>
nikename?> The Oicq are:
<?php echo $record->oicq?> "
Width= "Length=" >OICQ</a>

<a href=action.php?action=delete&key_liuyan=<?php echo $record->key_liuyan? >> Delete </a>
<a href=action.php?action=huifu&key_liuyan=<?php echo $record->key_liuyan?> > reply </a>


</th></tr>

<tr>
&LT;TD colspan= "3" ></tr>


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.