Sziasztok,
Egy kis segítséget kérnék.
Van egy contact formomom és azt szeretném, hogy, amikor rá mennek, hogy submit (email üzenet küldése), akkor egy URL címre (http://valami.hu/koszonjuk.html) irányítsa a felhasználót.
A form:
<form action="form.php" method="post" enctype="multipart/form-data">
<h1 class="title">Contact</h1>
<label></label>
<input name="name" required="required" placeholder="Your Name">
<label></label>
<input name="email" type="email" required="required" placeholder="Your Email">
<label></label>
<textarea name="message" cols="20" rows="5" required="required" placeholder="Message"></textarea>
<input id="cancel" name="cancel" value="Cancel" />
<input id="submit" name="submit" type="submit" value="Submit">
</form>
A PHP:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: YourWebsite.com';
$to = 'bmcsmartin77@gmail.com';
$subject = 'Email Inquiry';
$body = "From: $name\n E-Mail: $email\n Message:\n $message";
?>
<?php
if ($_POST['submit']) {
if (mail ($to, $subject, $body, $from)) {
//echo '<p>Thank you for your email!</p>';
} else {
echo '<p>Oops! An error occurred. Try sending your message again.</p>';
}
}
?>
KÖSZÖNÖM.