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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Location
    ...
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parse error: syntax error, unexpected T_VARIABLE in

    Here is my form.html:
    <form action="sendreserv.php" method="post">
    <p><label>Nom:
    <input name="rname" type="text" class="svform">
    </label></p>
    <p>
    <label>E-mail:
    <input name="remail" type="text" class="svform">
    </label>
    </p>
    <p>
    <label>Telephone:
    <input type="text" name="rtel" class="svform">
    </label>
    </p>
    <p>Nombre d'adultes:
    <select name="rnbradult" size="" class="svform">
    <option value="1" selected>1 personne</option>
    <option value="2">2 personnes</option>
    <option value="3">3 personnes</option>
    <option value="4">4 personnes</option>
    <option value="5">5 personnes et +</option>
    </select>
    <br>
    Nombre d'enfants:
    <select name="rnbrkid" class="svform">
    <option value="0" selected>Aucun</option>
    <option value="1">1 enfant</option>
    <option value="2">2 enfants</option>
    <option value="3">3 enfants</option>
    <option value="4">4 enfants</option>
    </select>
    </p>
    <p>Debutant
    <input name="rlevel" type="radio" value="1"><br>
    Intermediaire
    <input name="rlevel" type="radio" value="2"><br>
    Avance
    <input name="rlevel" type="radio" value="3"></p>
    <p>Debut des cours: <select name="rday" class="svform">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">28</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select>
    <select name="rmonth" class="svform">
    <option value="J">Jan</option>
    <option value="F">Fev</option>
    <option value="M">Mar</option>
    <option value="A">Avr</option>
    <option value="M">Mai</option>
    <option value="J">Juin</option>
    <option value="J">Juil</option>
    <option value="A">Aou</option>
    <option value="S">Sept</option>
    <option value="O">Oct<option>
    <option value="N" selected>Nov</option>
    <option value="D">Dec</option>
    </select>
    <select name="ryear" class="svform">
    <option value="06">2006</option>
    <option value="07">2007</option>
    <option value="08">2008</option>
    <option value="09">2009</option>
    </select>
    </p>
    <p>
    <label>Informations supplementaires: <br>
    <textarea name="rinfos" cols="35" rows="10" class="svform"></textarea>
    </label>
    </p>
    <p>
    <input name="submit" type="submit" value="Envoyer ">
    <input name="erase" type="reset" value="Effacer ">
    </p>
    </form>
    </div>
    </td>
    </tr>
    </table>



    Here is the sendreserv.php

    <?php
    $mailto = 'email@url.com' ;

    $subject = "Reservation form" ;

    $formurl = "http://www.url.com/fr/main.php?page=reserv" ;
    $errorurl = "http://www.url.com/error.html" ;
    $thankyouurl = "http://www.url.com/thankyou.html" ;

    // -------------------- END OF CONFIGURABLE SECTION ---------------

    $name = $_POST['rname'] ;
    $email = $_POST['remail'] ;
    $tel = $_POST['rtel'] ;
    $nbradult = $_POST['rnbradult'] ;
    $nbrkid = $_POST['rnbrkid'] ;
    $level = $_POST['rlevel'] ;
    $day = $_POST['rday'] ;
    $month = $_POST['rmonth'] ;
    $year = $_POST['ryear'] ;
    $infos = $_POST['rinfos'] ;
    $http_referrer = getenv( "HTTP_REFERER" );

    if (!isset($_POST['remail'])) {
    header( "Location: $formurl" );
    exit ;
    }
    if (empty($name) || empty($email) || empty($tel)) {
    header( "Location: $errorurl" );
    exit ;
    }
    $name = strtok( $name, "\r\n" );
    $email = strtok( $email, "\r\n" );
    if (get_magic_quotes_gpc()) {
    $tel = stripslashes( $tel );
    }

    $messageproper =

    "This message was sent from:\n" .
    "$http_referrer\n" .
    "------------------------- COMMENTS -------------------------\n\n" .
    Nom $name
    Email $email
    Telephone $tel
    Adultes $nbradult
    Enfant $nbrkid
    Niveau $level
    Date $day $month $year
    Informations supplementaires $infos

    "\n\n------------------------------------------------------------\n" ;


    mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: sendreserv.php 2.04" );
    header( "Location: $thankyouurl" );
    exit ;

    ?>


    What's wrong in that?
    I think the problem is around my <selected> & <option> tags.
    But why i always get an unexpected T_VARIABLE error?

    Thanks in advance!

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Its this part
    PHP Code:
    $messageproper =

    "This message was sent from:\n" .
    "$http_referrer\n" .
    "------------------------- COMMENTS -------------------------\n\n" .
    Nom $name
    Email $email
    Telephone $tel
    Adultes $nbradult
    Enfant $nbrkid
    Niveau $level
    Date $day $month $year
    Informations supplementaires $infos

    "\n\n------------------------------------------------------------\n" 
    Your strings aren't strings because you concatenate them just after your newline characters. Try this instead
    PHP Code:
    $messageproper =

    "This message was sent from:\n" .
    "$http_referrer\n" .
    "------------------------- COMMENTS -------------------------\n\n" .
    "Nom ".$name."\r\n".
    "Email ".$email."\r\n".
    "Telephone ".$tel."\r\n".
    "Adultes ".$nbradult."\r\n".
    "Enfant ".$nbrkid."\r\n".
    "Niveau "$level."\r\n".
    "Date ".$day." ".$month." ".$year."\r\n".
    "Informations supplementaires".$infos."\r\n".

    "\n\n------------------------------------------------------------\n" 
    Last edited by _Aerospace_Eng_; 11-01-2006 at 07:52 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Nov 2006
    Location
    ...
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you!


  •  

    Posting Permissions

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