A
Anonymous
Guest
Hello I am trying to get a H1 element into a variable in my PHP my code here is my code:
Any help?
Code:
<main>
<form class="contact-form" action="contactform.php" method="post" enctype="multipart/form-data">
<h1 name="product-name">1x1Logo</h1>
<div class="txtb">
<label>Vollständiger Name</label>
<input type="text" name="name" value="" placeholder="Vollständiger Name">
</div>
<div class="txtb">
<label>Farbe</label>
<input type="text" name="color" value="" placeholder="Wählen Sie eine Farbe.">
</div>
<div class="txtb">
<label>E-Mail</label>
<input type="text" name="mail" value="" placeholder="Ihre E-Mail">
</div>
<div class="txtb">
<label>Telefonnummer</label>
<input type="text" name="phone" value="" placeholder="Ihre Telefonnummer(nicht notwendig)">
</div>
<input type="file" name="attachment">
<div class="txtb">
<label>Botschaft</label>
<textarea name="message" placeholder="Schreiben..."></textarea>
</div>
<div class="submit-btn">
<button type="submit" name="submit">Senden</button>
</div>
<div class="help-btn">
<a type="submit" name="help">Um Rat fragen</a>
</div>
</form>
</main>
Code:
<?php
if (isset($_POST['submit'])) {
$product = $_POST['product-name'];
$name = $_POST['name'];
$color = $_POST['color'];
$mailFrom = $_POST['mail'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$mailTo = "test@victorogsigrid.dk";
$headers = "From: ".$mailFrom;
$txt = "You have received an e-mail from ".$name.".\n\n"."Product: ".$product.".\n\n"."Color: ".$color.".\n\n"."Mail/Phone: ".$mailFrom."/".$phone.".\n\n"."User Wrote: ".$message;
mail($mailTo, $product, $txt, $headers);
header("Location: ../index.php?mailsend");
echo('Mail has been send!');
}
?>
Any help?