接上面这是我的第2个页面result.php
原代码是<html>
<head>
<style type="text/css">
<!--
.{ font-family: "宋体"; font-size: 9pt;color:#000000}
-->
</style>
<body bgcolor=#cccccc>
<?
if ($nickname=="") {
print "<center><b><font color=#FF99FF>您的大名?</font><br>";
}
else if ($email=="") {
print "<center><b><font color=#FF99FF>您电子邮件?</font><br>";
}
else if ($note=="") {
print "<center><b><font color=#FF99FF>您没有要说的吗?</font><br>";
}else{
print "<p></p>";
$t = date(Y年m月d日);
$note = str_replace ( "<", "<", $note);
$note = str_replace ( ">", ">", $note);
$note = str_replace ( "\n", "<br>", $note); $main = "网上大名:<a href=\"mailto:$email\">$nickname</a>:($t)<br>留言: $note <br><hr>";
$f = fopen("note.txt","a");
fwrite($f,$main);
fclose($f);
print "<center><b><font color=#FF99FF>谢谢您的留言!</font><br>";
}
?><p><br></p>
<p><br></p>
<center><a href="note.php">返回</a></center>
<p><br></p>
<p align=right><font style=" color=color:#cccccc;font-size:12pt">作者:<a href="mailto:[email protected]">sunny</a><br>
主页:<a href="http://jingying.40it.com">精英网</a></font>
</center>
</body>
</html>
原代码是<html>
<head>
<style type="text/css">
<!--
.{ font-family: "宋体"; font-size: 9pt;color:#000000}
-->
</style>
<body bgcolor=#cccccc>
<?
if ($nickname=="") {
print "<center><b><font color=#FF99FF>您的大名?</font><br>";
}
else if ($email=="") {
print "<center><b><font color=#FF99FF>您电子邮件?</font><br>";
}
else if ($note=="") {
print "<center><b><font color=#FF99FF>您没有要说的吗?</font><br>";
}else{
print "<p></p>";
$t = date(Y年m月d日);
$note = str_replace ( "<", "<", $note);
$note = str_replace ( ">", ">", $note);
$note = str_replace ( "\n", "<br>", $note); $main = "网上大名:<a href=\"mailto:$email\">$nickname</a>:($t)<br>留言: $note <br><hr>";
$f = fopen("note.txt","a");
fwrite($f,$main);
fclose($f);
print "<center><b><font color=#FF99FF>谢谢您的留言!</font><br>";
}
?><p><br></p>
<p><br></p>
<center><a href="note.php">返回</a></center>
<p><br></p>
<p align=right><font style=" color=color:#cccccc;font-size:12pt">作者:<a href="mailto:[email protected]">sunny</a><br>
主页:<a href="http://jingying.40it.com">精英网</a></font>
</center>
</body>
</html>
2,运用update table set x='$x',y='$y'......;
3.函数
function viewerip()
{
$viewerip=getenv("http_x_forwarded_for");
$gateip=getenv("remote_addr");
if(!$viewerip)
$viewerip=$gateip;
return $viewerip;
}