Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

PHP code

Options
  • 16-01-2008 1:23pm
    #1
    Registered Users Posts: 314 ✭✭


    Hi just having a bit of trouble with this piece of code, it comes up with Parse error: syntax error, unexpected T_VARIABLE in E:\Other\xampp\htdocs\bookingformprocess.php on line 8
    Im new to programming so unsure what it meant..has it to do with $error?


    <?php /// bookingformprocess.php
    include 'includes.php';

    if (!isset($_POST) or empty($_POST)
    $error = 'You need to enter your name!';
    > Line 8

    else {
    $firstname = $_POST;
    }


Comments

  • Registered Users Posts: 610 ✭✭✭nialo


    Incorrect quotes around the error message...


  • Closed Accounts Posts: 583 ✭✭✭monkey tennis


    nialo wrote: »
    Incorrect quotes around the error message...

    Nope.

    The if statement hasn't been closed.


  • Registered Users Posts: 314 ✭✭Spectreon666


    the quotes are fine...how does the if statement close of then? its prob obvious but as i said im new to it!!


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,086 Mod ✭✭✭✭Tar.Aldarion


    )


  • Registered Users Posts: 314 ✭✭Spectreon666


    oh yeah did that but then it says

    Fatal error: Call to undefined function template() in E:\Other\xampp\htdocs\bookingformprocess.php on line 18

    if ($error) {
    // form data is invalid, redisplay form with error message from its template
    template('http://localhost/bookingform.tpl.php'); ----> line 18


  • Advertisement
  • Registered Users Posts: 2,934 ✭✭✭egan007


    You are calling a function 'template' on line 18.
    and it's undefined....

    Seriously though you are better off getting working scripts and modifying and understanding them. It will take you forever the way you are doing it now.


Advertisement