• hey i have been trying to solve this problem for week now dont know if you can help its a parse error i cant seem to solve..
    this is the line of codes

    <?php
    require_once($_SERVER[‘DOCUMENT_ROOT’]”../airads/myra/imports/path.php”);

    if(!$session->is_logged_in()){jump_to(“Auth.php”);}
    if($_SESSION[‘role’]==’Employee’){
    jump_to(’employee.php’);
    }
    if($_SESSION[‘role’]==’Administrator’){
    jump_to(‘administration.php’);
    }

    ?>

    This is how the error looks
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\htdocs\airads\myra\index.php on line 2
    if you can please assist
    thankyou.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Strings need a period (that’s a ‘.’) in between individual strings in order to concatinate them into one longer string. As an example:

    $string = "Hello" . " " . "World";

    That will output:

    Hello World

    For your example, you’ve left out the . that you need:

    require_once($_SERVER['DOCUMENT_ROOT'] . "../airads/myra/imports/path.php");

    Thread Starter ilash

    (@ilash)

    thankyou that helped but now this is what am getting.

    Warning: require_once(C:/xampp/htdocs../airads/myra/imports/path.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\airads\myra\index.php on line 2

    Fatal error: require_once() [function.require]: Failed opening required ‘C:/xampp/htdocs../airads/myra/imports/path.php’ (include_path=’.;C:\xampp\php\PEAR’) in C:\xampp\htdocs\airads\myra\index.php on line 2

    is it my installation or what am running on xamp version 2.5

    You need to start raeding the error messages. So far what you’ve shown us gives you all of the information that you need to know for debugging?

    Failed opening required ‘C:/xampp/htdocs../airads/myra/imports/path.php’ (include_path=’.;C:\xampp\php\PEAR’) in C:\xampp\htdocs\airads\myra\index.php on line 2

    In the file at C:\xampp\htdocs\airads\myra\index.php there’s a require() or require_once() function call, and the file that that’s tring to include (which is C:/xampp/htdocs../airads/myra/imports/path.php) doesn’t exist. You need to figure out why that URI path isn’t the right one.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘login system’ is closed to new replies.