Jump to content

[SOLVED] Problem with Arrays suddenly started


theresajayne

Recommended Posts

I installed apache 2.2 and php5 for dev work on my PC, (windows)

 

My file was working fine then suddenly i started getting the following error

 

Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\index.php on line 43

 

The line in question is

 

$error[] = "Invalid Username or Password";

 

 

I also have errors on every Array access I use

 

for instance

 

if( $_SESSION['loggedin'] == 'true')

 

gives me the error

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\index.php on line 9

 

 

WTF is going on??? it was working then suddenly went crazy like this.....

 

Theresa

 

Link to comment
Share on other sites

Dreamweaver 8 is the editor used

<?

        require_once('Smarty.class.php');

 

$page = 'login.html';

$t = new Smarty();

$vars = & get_input_vars();

` $error = array();

if( $_SESSION['loggedin'] == 'true')

{

//logged in so just display the front page

$user = array();

$user[login] = $_SESSION['login'];

$user[category] = $_SESSION['category'];

$user[first] = $_SESSION['first'];

$user[last] = $_SESSION['last'];

 

$t->assign('user',$user);

$page = 'index.html';

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.