• Log in or sign up for an account here: https://www.sythe.org/login

html email forwarding

  • Thread starter Thread starter Darkgroove
  • Start date Start date
D

Darkgroove

Guest
i'm making user services site where uses can come and fill out an order form of the services they want and the information i can use to contact them, such as their email, what they need trained, if they need a MM etc.

once the user fills out the order form, the page just refreshes. how can i make the information entered by the user, get sent to an email, so I actually know what they need?
 
Code:
<?php
if(isset($_POST['buttonname'])) {
$name=htmlspecialchars($_POST['name']) ;
$email=htmlspecialchars($_POST['email']) ;
$message=htmlspecialchars($_POST['message']) ;
$subject=htmlspecialchars($_POST['subject']) ;
$youremail="[email protected]" ;
if(empty($_POST['name']) || empty($_POST['email]) || empty($_POST['message']) || empty($_POST['subject'])) {
echo "You did not fill in some of the required values! Please go back and try again!" ;
}else{
mail(youremail,"Contact form","Message: $message  Email: $email","From: $name") or die('Could not send email, this will be fixed soon!') ;
header('thankyou.html') ;
exit() ;
}
}
?>
<form action="<?= $_SERVER['PHP_SELF'] ;?>" method="post" >
<input type="text" name="name" />
<input type="text" name="email" />
<input type="text" name="message" />
<input type="subject" name="subject" />
<input type="submit" name="buttonname" />
</form>

Just a basic one (Might be buggy, sorry I don't have much time now but the basics are in there!). Edit the required php data to suit your needs and save it as a php file (Such as mail.php).

For some rsgp, I could code you a custom (better) one for your needs.
 
Just a note, you need PHP installed (obviously) and a working mail server. If you're using a free host, there is a great chance that there won't be a mail server available for you to use.
 
Thanks guys, i'll get back to you on your offer pur3. Add my msn or something, and i'll let you know.
 
Runescape Gamblingrunescape gambling
Back
Top