I'm here first time, and i'd need a little help if it's possible, first of all my english is not good as most of people here, but i'll try to explain what I need
So i have contact form php script on my website, and i want to contact_form work only from 20:30 till 22:00
I have no idea how to do that, here is my php code
<?php
//Fetching Values from URL
$name = $_POST['name1'];
$email = $_POST['email1'];
$message = $_POST['message1'];
$contact = $_POST['contact1'];
//sanitizing email
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
//After sanitization Validation is performed
$subject = $name;
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
$headers .= 'From:' . $email. "
"; // Sender's Email
$headers .= 'Cc:' . $email. "
"; // Carbon copy to Sender
$template = '<div style="padding:50px; color:white;"><br/>'
. '<br/>'
. 'Ime:' . $name . '<br/>'
. 'IG Ime:' . $email . '<br/>'
. 'Pjesma:' . $contact . '<br/>'
. 'Poruka:' . $message . '<br/><br/>';
$sendmessage = "<div style=\"background-color:#7E7E7E; color:white;\">" . $template . "</div>";
// message lines should not exceed 70 characters (PHP rule), so wrap it
$sendmessage = wordwrap($sendmessage, 70);
// Send mail by PHP Mail Function
mail("inbox@ug-slike.com", $subject, $sendmessage, $headers);
echo "Vaša pjesma je naručena! Bit će uskoro emitirana.";
?>
and here is .js
$(document).ready(function(){
$("#submit").click(function(){
var name = $("#name").val();
var email = $("#email").val();
var message = $("#message").val();
var contact = $("#contact").val();
$("#returnmessage").empty(); //To empty previous error/success message.
//checking for blank fields
if(name==''||contact=='')
{
alert("Please Fill Required Fields");
}
else{
// Returns successful data submission message when the entered information is stored in database.
$.post("contact_form.php",{ name1: name, email1: email, message1:message, contact1: contact},
function(data) {
$("#returnmessage").append(data);//Append returned message to message paragraph
if(data=="Your Query has been received, We will contact you soon."){
$("#form")[0].reset();//To reset form fields on success
}
});
}
});
});
I assume that you don't need html code... so, is there anyone who could help me?
If anybody asks himself why I want active only 1:30 - 2 hours a day... it's because that's the time when peoeple will have time to order songs which they wanna listen on online radio where I'm a speaker & radio dj