View Full Version : Please help me solve my problem with Parse error: syntax error, unexpected T_STRING i

01-26-2012, 12:58 PM
I get the message:
Parse error: syntax error, unexpected T_STRING in /public/sites/www.musicalalmere.nl/formulier_afhandeling.php on line 4

Don't know what to do i'm a dummy in PHP so could someone help me?

This is the form!!!!!!

$Naam = $_POST['Naam'];
$Email = $_POST['Email'];
$Aantal Kaarten = $_POST['Aantal Kaarten'];
$vrijdag of zaterdagavond = $_POST['vrijdag of zaterdagavond'];
$BeRicht = $_POST['BeRicht'];

$formsent = mail('info@musicalalmere.nl',

'Reactie vanaf de website',

"Naam: $Naam
$Aantal Kaarten
$vrijdag of zaterdagavond
Bericht: $BeRicht",

"From: $EmailAdres\r\nBounce-to: ");

if ($formsent) {
echo "<p>Geachte $Naam ,<br><br>
Uw bericht is verzonden <br>
Hartelijk dank voor uw belangstelling.<br>
Wij nemen zo spoedig mogelijk contact met u op.
} else {
echo "<p>Sorry, er is iets misgegaan met het formulier, probeer het later nog eens.</p>";

And this is the html

<form action="formulier_afhandeling.php" method="post">

under is between body

<td width="130"><p>Naam</td>
<td> <input name="Naam" type="text" size="30" ></td>
<td width="130"><p>Email</td>
<td> <input name="Email" type="text" size="30"></td>
<td width="130"><p>Aantal Kaarten</td>
<input name="Aantal Kaarten" type="text" size="30"></td>
<td width="130"><p>vrijdag of zaterdagavond</td>
<input name="vrijdag of zaterdagavond" type="text" size="30"></td>
<td width="130" valign="top"><p>Bericht :</td>
<textarea name="BeRicht" style="width: 250; height: 116;" rows="1" cols="20"></textarea><p>
<INPUT TYPE="Submit" VALUE="Verzenden">

Hopefully you'll understand me because i'm dutch.

Greets Lia

01-26-2012, 01:15 PM
You can't have spaces in the variable name. also don't think you can have spaces in the post value either.

$Aantal Kaarten = $_POST['Aantal Kaarten'];
$vrijdag of zaterdagavond = $_POST['vrijdag of zaterdagavond'];

change to this

$Aantal_Kaarten = $_POST['AantalKaarten'];
$vrijdag_of_zaterdagavond = $_POST['vrijdagofzaterdagavond'];

01-26-2012, 01:16 PM
$Aantal Kaarten = $_POST['Aantal Kaarten'];
$vrijdag of zaterdagavond = $_POST['vrijdag of zaterdagavond'];

this... no no... :D

spaces in variables is not allowed...


$Aantal_Kaarten = $_POST['Aantal_Kaarten'];
$vrijdag_of_zaterdagavond = $_POST['vrijdag_of_zaterdagavond'];

you will need to change the names in the form fields you are sending from too

<input name="Aantal_Kaarten" type="text" size="30"></td>
<td width="130"><p>vrijdag of zaterdagavond</td>
<input name="vrijdag_of_zaterdagavond" type="text" size="30"></td>

01-26-2012, 01:45 PM
Thanks for the quick answer. It does work now but it's a form where people can order tickets for the show. now i'm getting the wrong text they write.

Bij Name he correctly send there name but, at the Aantal_kaarten i'll get the word kaarten but i need the amound they typed so i want to see 4 or 5 etc.
Also by vrijdagavond_of_zaterdagavond i'll get of zaterdagavond but i typed vrijdagavond so i think that also this is incorrect. Email is no problem that's correctly.

So my new answer is how can i get in my email the amound of tickets by the text Aantal_kaarten and how can i get the text the people choose by the text vrijdagavond_of_zaterdagavond?

Here the email i got:

Naam: Lia van dongen
Kaarten Here i want the amound and not the word Kaarten because kaarten means tickets and i want to know how many but the people have to see the word Kaarten so they know what to fill in
of zaterdagavond here he always placed this text but they have to choose between vrijdagavond (fridaynight) of zaterdagavond (saturdaynight)
Bericht: Ik heb er zin in

Hopefully you'll understand me

01-26-2012, 02:06 PM
It works thanks all i did'nt changed the words in formsent

Again thanks alot!!!!!!!!!