I got the following script to let ppl send me a msg.
I thought i made it so ppl can only send me a msg, every 15 minutes, but i screwed this part up.
hope someone can fix this for me,heres the code:
[code=php]
if(isset($_POST[‘submit’])){
if($_POST[‘message’] != “” AND $_POST[‘message’] != ” “){
if(!isset($_SESSION[‘msg’])){
$_SESSION[‘msg’] = time();
$sender = $_SESSION[‘user’];
$headers = “From: $sender”;
$message = HTMLSPECIALCHARS($_POST[‘message’]);
if($_POST[‘do’] == “Report Bug”){
if(mail(“[email protected]”, “Bug Report”, $message, $headers)){
header(“Location: index.php?done=reportbug”);
}
else{
$error = “<p id=’error’>ERROR: Bug report could not be send.</p>”;
}
}
else if($_POST[‘do’] == “Msg acemo”){
if(mail(“[email protected]”, “Msg acemo”, $message, $headers)){
header(“Location: index.php?done=msgacemo”);
}
else{
$error = “<p id=’error’>ERROR: Message could not be send.</p>”;
}
}
}
else{
$current_time = time();
$last_message = $_SESSION[‘msg’];
$time_since_last_message = $current_time – $last_message;
if($time_since_last_message <= “900”){
$_SESSION[‘msg’] = time();
$sender = $_SESSION[‘user’];
$headers = “From: $sender”;
$message = HTMLSPECIALCHARS($_POST[‘message’]);
if($_POST[‘do’] == “Report Bug”){
if(mail(“[email protected]”, “Bug Report”, $message, $headers)){
header(“Location: index.php?done=reportbug”);
}
else{
$error = “<p id=’error’>ERROR: Bug report could not be send.</p>”;
}
}
else if($_POST[‘do’] == “Msg acemo”){
if(mail(“[email protected]”, “Msg acemo”, $message, $headers)){
header(“Location: index.php?done=msgacemo”);
}
else{
$error = “<p id=’error’>ERROR: Message could not be send.</p>”;
}
}
}
else{
$error = “<p id=’error’>ERROR: U have sended a msg/bug report in the last 15 minutes.</p>”;
}
}
}
else{
$error = “<p id=’error’>ERROR: Message left empty.</p>”;
}
}