H1 Element



Hello I am trying to get a H1 element into a variable in my PHP my code here is my code:
      <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 class="txtb">
          <input type="text" name="color" value="" placeholder="Wählen Sie eine Farbe.">

        <div class="txtb">
          <input type="text" name="mail" value="" placeholder="Ihre E-Mail">

        <div class="txtb">
          <input type="text" name="phone" value="" placeholder="Ihre Telefonnummer(nicht notwendig)">
          <input type="file" name="attachment">
        <div class="txtb">
          <textarea name="message" placeholder="Schreiben..."></textarea>
        <div class="submit-btn">
          <button type="submit" name="submit">Senden</button>
        <div class="help-btn">
          <a type="submit" name="help">Um Rat fragen</a>


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?
What is your problem? Explain clearly what you expect to happen and what actually happens.

Your PHP code has problems.
I want to get my H1 element into the product_name variable in my PHP code (sorry for the late answer)
You don't have a "product_name" variable?

Your problem has not been explained clearly, without knowing what you expect and what you are struggling with, I cannot help you.

Do you know how to set a variable?
First of all you can't use h1 element tag you need to use an input of some sort:

for example:

<input class="image-upload" type="file" name="file">

where you can call name="file" this name="product" if you want, but I normally don't do that.

You don't have to do it this you can use a selection element which I think you are more after, but first things first. That is to get the code to work correctly. Then you would do something line the follow (that is if you want to process the image itself) :

$product = $_FILES['file']['tmp_name'];

then process of that file can occur.

However, I think you are more after something like the following:

<select name="product" id="product">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>

If you want to "display" the image of the product then I would recommend using radio or check boxes instead.