0

I have a PHP form with a submit button in my html. However when I press the submit button my browser gives an error -> HTTP error 500.

I am using the same type of PHP form on other sites and there it works fine... Anybody sees the problem here?

Form and HTML in snippet below.

<?php

$lidworden = $_POST['lidworden']
$projectsponsoring = $_POST['projectsponsoring'];
$leo = $_POST['leo'];
$lion = $_POST['lion'];
$andere = $_POST['andere'];
$naam = $_POST['naam'];
$email = $_POST['email'];
$bericht = $_POST['bericht'];

$to = "info@pieterswebdesign.com";
$subject = "Leo Club de 4 Ambachten";
$body = "Dit is een automatisch bericht gelieve hier niet op te reageren. \n\n $lidworden,$projectsponsoring,$leo,$lion,$andere,$Naam,$Email,$Telefoon,$Bericht";

mail($to,$subject,$body);
header("Location: index.html");

exit();
?>
<form id="form" action="send.php" method="POST">

  <p id="radiotitle"><span class="bluetxt">Je bent</p>

        <div id="radiodiv">
            <label class="label">
                <input type="radio" name="lidworden" value="lidworden" />geïnteresseerd om lid te worden
            </label>
            <label class="label">
                <input type="radio" name="projectsponsoring" value="projectsponsoring" />geïnteresseerd in projectsponsoring
            </label>
            <label class="label">
                <input type="radio" name="leo" value="leo"/>een Leo
            </label>
            <label class="label">
                <input type="radio" name="lion" value="lion"/>een Lion
            </label>
            <label class="label">
                <input type="radio" name="andere" value="andere"/>andere
            </label>
        </div>

        <div id="textdiv">
                    <label class="label2">Je naam</label>
                        <input type="text" name="naam" placeholder="Typ hier..." />

                        <label class="label2">Je e-mailadres</label>
                            <input type="text" name="email"  placeholder="Typ hier..." />

                            <label class="label2">Je bericht</label>
                                <textarea type="text" name="bericht" value="bericht" placeholder="Typ hier..."></textarea>

            <button type="submit" id="sendbutton"><p>VERSTUUR</p></button>
        </div>
    </form>
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Pieter
  • 111
  • 12

1 Answers1

1

Typos:

<?php

$lidworden = $_POST['lidworden']
                                ^---missing ;

causing a fatal parse error... Since you obviously didn't see the error message, you're running with display_errors and error_reporting disabled. They should NEVER be off on a devel/debug system. It's the equivalent of stuffing your fingers in your ears and going "lalalala can't hear you".

Marc B
  • 356,200
  • 43
  • 426
  • 500