4Fun.forumhit.ro
Welcome!!
Te rog sa te autentifici sau sa te inregistrezi
Cautare
 
 

Rezultate pe:
 


Rechercher Cautare avansata

Country
Your Country Your IP
Votati-ne
Promovare Gratuita - Top123Top88 - Director webTop25.rotop 90Page RankLinkPro - Director Web
Clock

PHP Guestbook

Vezi subiectul anterior Vezi subiectul urmator In jos

PHP Guestbook

Mesaj  Admin la data de Sam Iun 13, 2009 8:35 pm

Code:
<?php

$name = $_POST['name']; //start declaring
$email = $_POST['email'];
$site = $_POST['site'];
$time = date("H:i dS F"); // date and time prefered way
$ip = $_SERVER['REMOTE_ADDR']; //get users ip
$message = $_POST['message']; //finish declaring

if(isset($_POST['sign'])){

if(empty($name) || empty($email) || empty($message)){
$error = "Please enter all fields that are marked with a *";
}

else {
//bad language filter.
$message = str_replace(" ass "," ~censored~ ",$message);
$message = str_replace(" fuck"," ~censored~ ",$message);
$message = str_replace(" bitch "," ~censored~ ",$message);
$message = str_replace(" biatch "," ~censored~ ",$message);
$message = str_replace(" nigger "," ~censored~ ",$message);
$message = str_replace(" porn "," ~censored~ ",$message);
$message = str_replace(" nigga "," ~censored~ ",$message);
$message = str_replace(" gay "," ~censored~ ",$message);
$message = str_replace(" tit "," ~censored~ ",$message);
$message = str_replace(" wanker "," ~censored~ ",$message);
$message = str_replace(" wanka "," ~censored~ ",$message);
$message = str_replace(" penis "," ~censored~ ",$message);
$message = str_replace(" shit "," ~censored~ ",$message);
$message = str_replace(" bollocks "," ~censored~ ",$message);
$message = str_replace(" bollox "," ~censored~ ",$message);


//grammer filter Wink
#$message = str_replace(" u "," you ",$message);
#$message = str_replace(" U "," You ", $message);
#$message = str_replace(" r "," are ", $message);
#$message = str_replace(" R "," Are ", $message);
#$message = str_replace(" y "," why ", $message);
#$message = str_replace(" Y "," Why ", $message);
#$message = str_replace(" i "," I ", $message);
#$message = str_replace(" o "," oh ", $message);
#$message = str_replace(" O "," Oh ", $message);

$file = "signed.html";
$emailfile = "emails.html";

$fh = fopen($file, "a+");
fwrite($fh, "
");
fwrite($fh, "
<hr>");
fwrite($fh, "
");
fwrite($fh, "<font color=#CDC5BF>Name:</font> "."[Only registered and activated users can see links. Click Here To Register...]
");
fwrite($fh, "
");
fwrite($fh, "<font color=#CDC5BF>Time:</font> ".$time."
");
fwrite($fh, "
");
fwrite($fh, "<font color=#CDC5BF>Comment:</font> ".$message."
");
fwrite($fh, "
");

fclose($fh);

$open = fopen($emailfile, "a+");
fwrite($open, "
");
fwrite($open, "
<hr>
");
fwrite($open, "
");
fwrite($open, "Name: ".$name."
");
fwrite($open, "
");
fwrite($open, "Email: ".$email."
");
fwrite($open, "
");
fwrite($open, "IP: ".$ip."
");
fwrite($open, "
");

fclose($open);

}



}
?>

<html>
<head><title>Comment Book<title>
<style type='text/css'>
#main {
width: 50%;
padding: 10px;
margin: auto;
background-color: #7F7F7F;
border: 2px solid #CDC5BF;
}

body {
background-color: black;
padding: 10px;
margin: 0;
}

#comments {
width: 50%;
padding: 10px;
margin: auto;
background-color: #7F7F7F;
border: 2px solid #CDC5BF;
}

font {
color:#FFFFFF;
font-family: Verdana;
}

input {
width: 250px;
}

h1 {
color: #FFFFFF;
}

h2 {
color: #FFFFFF;
font-size:16px;
}

a {
color: white;
}

#error {
color: red;
font-family: Verdana;
width: 50%;
padding: 10px;
margin: auto;
background-color: #7F7F7F;
border: 2px solid #CDC5BF;
}


</style>
</head>

<body>

<div id='error'>
<?php
print $error;
?>
</div>




<div id='main'>

<div align='center'>
<h1>Comment Book</h1>
<h2>[Only registered and activated users can see links. Click Here To Register...]</h2>
</div>

<form action='<?php $_SERVER['PHP_SELF']; ?>' method='post'>
<font>*Name:</font>

<input type='text' name='name'>



<font>*Email:</font>

<input type='text' name='email'>



<font>Website: (Do Not Include http://)</font>

<input type='text' name='site'>



<font>*Message</font>

<textarea cols='75' rows='5' name='message'></textarea>



<input type='submit' value='Sign Comment Book' name='sign' style='height: 35px; width: 180px'>




</form>
</div>




<div id='comments'>
<!--<font>Comments made...
</font>-->
<?php

$filename = "signed.html";

$file = fopen($filename, 'r');

$filesize = filesize ($filename);

$comments = fread($file, $filesize);

//print $filesize;
print $comments;

fclose($file);

?>


</div>






</body>
</html>Made by ottoom

Admin
Admin

Numarul mesajelor : 67
Puncte : 201
Data de inscriere : 23/05/2009

Vezi profilul utilizatorului http://4fun.forumhit.ro

Sus In jos

Vezi subiectul anterior Vezi subiectul urmator Sus


 
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum