Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

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

    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!!!!!!

    PHP Code:
    <?
    $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 
    $Email 
    $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>
    <br>
    <br> 
    Hartelijk dank voor uw belangstelling.<br>
    Wij nemen zo spoedig mogelijk contact met u op.
    .</p>"
    ;
    } else {
    echo 
    "<p>Sorry, er is iets misgegaan met het formulier, probeer het later nog eens.</p>";
    }
    ?>
    And this is the html

    Code:
    <html>
    <head>
    <form action="formulier_afhandeling.php" method="post">
    </head>
    
    
    under is between body
    
    <table>
    <tr>
    <td width="130"><p>Naam</td>
    <td> <input name="Naam" type="text" size="30" ></td>
    </tr>
    <tr>
    <td width="130"><p>Email</td>
    <td> <input name="Email" type="text" size="30"></td>
    </tr>
    <tr>
    <td width="130"><p>Aantal Kaarten</td>
    <td> 
    <input name="Aantal Kaarten" type="text" size="30"></td>
    </tr>
    <tr>
    <td width="130"><p>vrijdag of zaterdagavond</td>
    <td> 
    <input name="vrijdag of zaterdagavond" type="text" size="30"></td>
    </tr>
    <tr>
    <td width="130" valign="top"><p>Bericht :</td>
    <td> 
    <textarea name="BeRicht" style="width: 250; height: 116;" rows="1" cols="20"></textarea><p>
    <INPUT TYPE="Submit" VALUE="Verzenden">
    </td>
    </tr>
    </table>
    </body>
    </form>
    </html>
    Hopefully you'll understand me because i'm dutch.

    THANKS!!!!!!
    Greets Lia
    Last edited by Inigoesdr; 01-26-2012 at 05:13 PM.

  • #2
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,453
    Thanks
    71
    Thanked 102 Times in 101 Posts
    You can't have spaces in the variable name. also don't think you can have spaces in the post value either.

    PHP Code:
    $Aantal Kaarten $_POST['Aantal Kaarten'];
    $vrijdag of zaterdagavond $_POST['vrijdag of zaterdagavond']; 
    change to this

    PHP Code:
    $Aantal_Kaarten $_POST['AantalKaarten'];
    $vrijdag_of_zaterdagavond $_POST['vrijdagofzaterdagavond']; 
    Been a sign maker for 7 years. My business:
    American Made Signs

  • Users who have thanked myfayt for this post:

    liavandongen (01-26-2012)

  • #3
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    PHP Code:
    $Aantal Kaarten $_POST['Aantal Kaarten'];
    $vrijdag of zaterdagavond $_POST['vrijdag of zaterdagavond']; 
    ^
    this... no no...

    spaces in variables is not allowed...

    try
    PHP Code:
    $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

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

  • Users who have thanked jmj001 for this post:

    liavandongen (01-26-2012)

  • #4
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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
    c.dongenvanotte@upcmail.nl
    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

  • #5
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    It works thanks all i did'nt changed the words in formsent

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •