Jump to content

c3118526

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by c3118526

  1. <?php//Collect the details from the form using $_GET server variable$name = $_GET["name"];$sname = $_GET["surname"];$email = $_GET["emailad"];$ad1 = $_GET["adline1"];$ad2 = $_GET["adline2"];$post = $_GET["postcode"];//Checking and Validation$errorString ="";if (empty($name)) { $errorString = "Enter your name<br>";}if (empty($sname)) { $errorString = "Enter your surname<br>";}if (empty($email)) { $errorString = $errorString. "Enter your email<br>";} if (empty($ad1)) { $errorString = $errorString. "Enter the first line of your address<br>";}if (empty($ad2)) { $errorString = $errorString. "Enter the second line of your address<br>";}if (empty($post)) { $errorString = $errorString. "Enter your postcode"; }//If there were errors - report them and exitif (!empty($errorString)){ $errorString = "<h3>There were errors</h3>".$errorString ; print $errorString; exit;}else { print "Thank you $name for requesting a copy of our catalogue <br> We have sent a copy of the information to your email address: $email";}$from = "Pet Planet <bethany_1@blueyonder.co.uk>";$to = "$email";$subject = "Catalogue request details";$body = "Hi $name, /n Thankyou for ordering our catalogue. It has been sent to the following address: /n $ad1 /n $ad2 /n $post";if (mail($to, $subject, $body)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); }?>

  2. Hi all, I am having a problem creating a time specific greeting, I would like the current date and time displayed, which preferably self updates so doesn't need to be constantly refreshed, I would also like a message displayed stating "Good morning" or "Good afternoon" depending on the current time, i.e. if the cuurrent time is between midnight and 11.59 am then the message will say "Good morning" and after that will say "Good afternnon"Sorry for the long post, your'e help would be greatly appreciated.

×
×
  • Create New...