So basically I’ve done this so far and it worked one of the times but then I changed something maybe some quotations and for some reason it just doesn’t wok anymore… Here’s the code:
<?php
//if "email" variable is filled out, send email
if (isset($_REQUEST['email'])) {
//Email information
$admin_email = "[email protected]";
$email = $_REQUEST['email'];
$name = $_REQUEST['name'];
$message = $_REQUEST['message'];
//send email
mail($admin_email, "$name", $message, "From:" . $email);
//Email response
echo "<h2 style='text-align:center;'>Your message has just been sent!</h2>";
}
//if "email" variable is not filled out, display the form
else {
?>
<form method="post" action="#contact">
<div class="field half">
<label for="name">Name</label>
<input type="text" name="name" id="name" />
</div>
<div class="field half">
<label for="email">Email</label>
<input type="email" name="email" id="email" />
</div>
<div class="field">
<label for="message">Message</label>
<textarea name="message" id="message" rows="4"></textarea>
</div>
<ul class="actions">
<li><input type="submit" value="Send Message" class="button special" style="background:white;opacity:0.75;" /></li>
</ul>
</form>
<?php
}
?>
Can anyone tell me what I’m doing wrong?
PS.: I’m a newie/noob.