Hallo,
bin neu hier, kenne mich mit php sogut wie 0 aus. Möchte bevor meine Homepage Online geht noch ein Kontaktformular haben.
Gebaut ist es schon, aber ansonsten geht da gar nicht, habe auch schon verschiedenste Skripte ausprobiert, aber da tut sich überhaupt nichts.
Kann mir bitte bitte jemand helfen???
HTML
<form action="contact.php" method="post">
<div class="contactleft"><label for="wpcf_your_name">Name:* </label></div>
<div class="contactright">
<input type="text" name="wpcf_your_name" id="wpcf_your_name" size="30" maxlength="100" value="" />
</div>
<div class="contactleft"><label for="wpcf_email">E-Mail:*</label></div>
<div class="contactright">
<input type="text" name="wpcf_email" id="wpcf_email" size="30" maxlength="50" value="" />
</div>
<div class="contactleft"><label for="wpcf_website">Subject:</label></div>
<div class="contactright">
<input type="text" name="wpcf_website" id="wpcf_website" size="30" maxlength="100" value="" />
</div>
<div class="contactleft"><label for="wpcf_msg">Message: </label></div>
<div class="contactright">
<textarea name="wpcf_msg" id="wpcf_msg" cols="35" rows="8" ></textarea><br />Fields with * are required
</div>
<div class="contactright">
<input type="image" name="Submit" src="css/p-img/contact-button.png" value="Send" id="contactsubmit" />
</div>
<div class="contactright">
</div>
</form>
Alles anzeigen
und hier der Skript:
PHP
<?php $to = "mail@mail.de";
$subject = "Contact";
$name = $_REQUEST['wpcf_your_name'] ;
$email = $_REQUEST['wpcf_email'] ;
$message = $_REQUEST['wpcf_msg'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $name, $message, $headers) ; if($sent)
{print "Your mail was sent successfully"; }
else {print "We encountered an error sending your mail"; } ?>