FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


FIXED: unexpected T_VARIABLE





DanielXP
Fixed
ncwdavid
Code:

else
{
echo "Er na.";
}
}
else
{
echo "Er na.";
}
}
else
{


Im no expert at php but i had a quick look at it and if you look at the last else in the code above the curly bracket on top does not open or close with anything or the curly bracket below it does not open or close with anything. That might be cuasing the error. Please tell me it it works?
DanielXP
ncwdavid wrote:
Code:

else
{
echo "Er na.";
}
}
else
{
echo "Er na.";
}
}
else
{


Im no expert at php but i had a quick look at it and if you look at the last else in the code above the curly bracket on top does not open or close with anything or the curly bracket below it does not open or close with anything. That might be cuasing the error. Please tell me it it works?


what the
Code:
else
{
echo "Er na.";


One?

That closes
-----------------------------------
else
{
echo "Er na.";
}
}
hexkid
DanielXP wrote:
Code:
else
{ <---- Line 2274
echo "Er na.";
}
}


I don't have a clue as the code is pritty long

If you could help thanks


2274 lines!!!!!!!!!!11111one
Don't do that!

Do break your code into small functions.
Do break your script into separate files.
Do include (or require, or require_once) the files.
Do indent the PHP code, don't worry about HTML.

for example
Code:
//...
switch ($something) {
    case "shop":
        process_shop(); // defined in an included file
        break;
    case "other":
        process_other(); // defined in an included file
        break;
    default:
        process_default(); // defined in an included file
        break;
}
// ...


Also I noticed a line with a syntax error: the condition for the if isn't enclosed in parenthesis.
Quote:
Code:
//...
if $logged[username] && $logged[userlevel] > 12)
{
}
else
// ...


Do indent the PHP code, don't worry about HTML.
DanielXP
Right no understand that but i fixed it

Thanks for your help
hexkid
And, please, don't remove the question after you get the answer.


We don't want to have this forum filled with thing like

Quote:
Q: never mind
Quote:
A: you need to use the superglobal arrays $_GET and/or $_POST.
Related topics
Help with PhpBB
need some help - php switch code
Php Syntax Errors, Need Help
insert data to mySQL database problem
Delete data from MySQL database problem!!
Points Scripts
unexpected T_VARIABLE, expecting
PHP - Error
Spliting Date
phpbb & wiki on same database?
Guestbook problem. PLEASE HELP!
BB Code [EDIT: Offering 150 FRIH$]
Open 2 Directorys at Once.
php array() problem
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.