Note that there are some explanatory texts on larger screens.

plurals
  1. POMy contact form sends blank body_messages
    primarykey
    data
    text
    <p>I’m new to PHP so bear with me. My form is sending empty emails when I press submit. Any help would be great.</p> <p>This is my form:</p> <pre><code> &lt;form class="contact_form" action="kontakt.php" method="post"&gt; &lt;p&gt;&lt;input type="text" required="required" id="name" name="name" class="text_input" value="" size="22" /&gt; &lt;label for="name"&gt;Namn *&lt;/label&gt;&lt;/p&gt; &lt;p&gt;&lt;input type="text" required="required" id="company" name="company" class="text_input" value="" size="22" /&gt; &lt;label for="company"&gt;Företag *&lt;/label&gt;&lt;/p&gt; &lt;p&gt;&lt;input type="email" required="required" id="email" name="email" class="text_input" value="" size="22" /&gt; &lt;label for="email"&gt;Epost *&lt;/label&gt;&lt;/p&gt; &lt;p&gt;&lt;textarea required="required" name="content" class="textarea" cols="30" rows="5"&gt;&lt;/textarea&gt;&lt;/p&gt; &lt;p&gt;&lt;button type="submit" class="button white"&gt;&lt;span&gt;Skicka&lt;/span&gt;&lt;/button&gt;&lt;/p&gt; &lt;input type="hidden" value="info@web.se" name="contact_to"/&gt; &lt;/form&gt; </code></pre> <p>And my PHP code so far is:</p> <pre><code>&lt;?php $name = $_POST['name']; $company = $_POST['company']; $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL); $content = $_POST['content']; $mail_to = 'info@web.se'; $subject = 'Lilla form'.$name; $body_message = 'From: '.$name."\n"; $body_message .= 'E-mail: '.$email."\n"; $body_message .= 'Message: '.$content; $headers = 'From: '.$email."\r\n"; $headers .= 'Reply-To: '.$email."\r\n"; $mail_status = mail($mail_to, $subject, $body_message, $headers); ?&gt; </code></pre> <p>Please help me, I’m really stuck.</p> <p>Thank you all!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload