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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

PHP code

  • 16-01-2008 12:23pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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,110 Mod ✭✭✭✭Tar.Aldarion


    )


  • Registered Users, Registered Users 2 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, Registered Users 2 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