Vi prego Aiutatemi...!!
Mi dareste un'okkiata al gbook?
- Quando metto " oppure ' mi scrive \" oppure \'.
- Di tanto in tanto mi mette uno spazio ke nn dovrebbe esserci.
<html>
<head>
<style type="text/css">
p.margin {margin-left: 1cm ;
font-style: oblique;
font-size: 12px;font-family: Times New Roman;
color:#000000}
a:link {color: #000000;font-size: 12px}
a:visited {color: #000000;font-size: 12px}
a:hover {color: red;font-size: 12px}
a:active {color: #000000;font-size: 12px}
table.msg{
border:solid;
border-width: 1px;
margin-bottom:1px;
margin-top:1px;
background-color:transparent;
}
td
{
font-size: 12px;
color:#000000
}
TEXTAREA{border-style: solid;
border-width: 1;
border-color: #000000;
background-color:slate;
color: #000000;
font-family: Verdana,Tahoma,Arial;
font-size: 9pt;
width :300px}
INPUT {border-style: solid;
border-width: 1;
border-color: #000000;
background-color:slate;
color: #000000;
font-family: Verdana,Tahoma,Arial;
font-size: 9pt;
width :200px}
input.button {border-style: solid;
border-width: 1;
border-color: #000000;
background-color:slate;
color: white;
font-family: Verdana,Tahoma,Arial;
font-size: 9pt;width :145px}
</style>
</head>
</body bgcolor="gainsboro" text="#000000">
<table width=80% align=right cellpadding=0 cellspacing=0 border=0 valign=top height=250>
<tr><td width=50%>
<?php
echo "
<form action=\"$PHP_SELF\" method=\"POST\" name=guest>
name:
<input type=\"text\" name=\"name\">*
E-mail:
<input type=\"text\" name=\"email\">*
Place:
<input type=\"text\" name=\"place\">*
Message:*
[/b]<textarea cols=\"40\" rows=\"10\" name=message></textarea>
<input type=\"submit\" name=\"submit\" value=\"sign!\" class=\"button\">
<input type=\"reset\" name=\"reset\" class=\"button\">
</form>";
?>
</td><td valign=top width=50%>
<table width=100% valign=top border=0 cellpadding=0 cellspacing=0 height=100%>
<tr><td valign=top height=50% align=center>
<?php
if($HTTP_POST_VARS['submit']){
$errmsg="";
//below section checks that name feild is empty or not/////////////////////////////////////
if(empty($name))
{
echo "<font color=\"red\" size=\"1\" face=\"verdana\">You failed to enter your name</font>
";
}
//below section checks that email feild is empty or not/////////////////////////////////////////////
if(empty($email))
{
echo "<font color=\"red\" size=\"1\" face=\"verdana\">You failed to enter your email address</font>";
}
///////////////////////////below section checks that you have enter place or not
if(empty($place))
{
echo "<font color=\"red\" size=\"1\" face=\"verdana\">You failed to enter your place</font>";
}
///////////////////////////below section checks that you have enter message or not
if(empty($message))
{
echo "
<font color=\"red\" size=\"1\" face=\"verdana\">You failed to enter your message</font>";
}
//if every thing is filled////////////////////////////////
if(!empty($name)&&!empty($email)&& !empty($place)&&!empty($message))
{
/////////////////////////////checks for the correct format of the email////////////////////////////////
if(!eregi("^[A-za-z0-9\_-]+@[A-za-z0-9\_-]+.[A-za-z0-9\_-]+.*",$email))
{
$errmsg.="Your email address is not in a correct format";
echo <<< THIS
<font color="red" face="verdana" size="+1">Your email address is not in a correct format</font>
THIS;
}
//////////////////////////////end of email check///////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
include 'smile.php';
$HTTP_POST_VARS['message']=$message;
////////////////////////////if error message is empty///////////////////////////////
if(empty($errmsg))
{
$filename="data.txt";
$fptr=fopen($filename,"r");
$content=fread($fptr,filesize ($filename));
fclose($fptr);
////////////////////////////checks whether email already exits or not//////////////////////////////////
if(strstr($content,$email))
{
echo "
<font color=\"red\" size=\"1\" face=\"verdana\">You have already signed the guest book</font>";
}
else
{
echo "<center><font face=\"verdana\" color=\"red\" size=\"1\">Thank you for signing our Guest book!!
";
echo "The following data has been added to the guest book</font>";
echo "<p align=\"center\">".(htmlspecialchars($name))."
".$email."
".(nl2br($message))."
".$place."</p>";
echo "<a href=\"view.php\">view our Guestbook</a></center>";
/////////////////////////////
$fp = fopen('data.txt','a');
if(!$fp) {
echo "Error opening file!";
exit;
}
$line = date("d.F.Y") . "#" . $HTTP_POST_VARS['name'];
$line .= "#" . $HTTP_POST_VARS['email'];
$line .= "#" . ucfirst($HTTP_POST_VARS['message']);
$line .= "#" . ucfirst($HTTP_POST_VARS['place']);
$line = str_replace("\r\n","
",$line);
$line .= "\r\n";
fwrite($fp, $line);
if(!fclose($fp)) {
echo "Error closing file!";
exit;
}
}//end of else
}
//error message is empty do a above
///////////////////////////
}
}
?>
</td></tr>
<tr><td height=50% align=center valign=top>
<?php
echo <<< END
Smileys:
<script language="JavaScript" src="script.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
function setSmile(str)
{
obj = document.guest.message;
obj.focus();
obj.value = obj.value + str;
}
//-->
</script>
[img]img/smile.gif[/img]
[img]img/wink.gif[/img]
[img]img/cool.gif[/img]
[img]img/curve-smile.gif[/img]
[img]img/tongue.gif[/img]
[img]img/biggrin.gif[/img]
[img]img/frown.gif[/img]
[img]img/astonish.gif[/img]
[img]img/crazy.gif[/img]
[img]img/fright.gif[/img]
[img]img/smoke.gif[/img]
[img]img/evil.gif[/img]
[img]img/apple.gif[/img]
[img]img/moo.gif[/img]
END;
?>
[View Guestbook]
</td></tr></table>
</td></tr></table>
</body>
</html>
Grazie di cuore