Another Login Error
Moderator: General Moderators
-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
Another Login Error
I am making a login using sessions, when the user and pass is checked to the database and returns true then Session record their username, and gives permission. Redirected to another page, here is the code of my page.
I get an error on line 55: Parse error: parse error, unexpected $
Can anyone shed any light why it won't work?
I get an error on line 55: Parse error: parse error, unexpected $
Can anyone shed any light why it won't work?
Last edited by anthony88guy on Thu May 12, 2005 6:11 pm, edited 2 times in total.
-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
that's exactly why I always use this sort of style
Code: Select all
if($somevar)
{
echo 'something';
}
else
{
echo 'something else';
}- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Hmm... I prefer a K&R (EDIT-the Rcharacter got munged) style for conditionals:
and BSD for functions (which is the style Feyd uses)
Bracing styles are a matter of personal preference, but make sure you're consistent.
Code: Select all
if ($bang == 'big') {
//More stuff
} elseif ($foo == 'lob' && empty($mar)) {
//Stuff
} else {
exit;
}Code: Select all
function general_convertChar()
{
return 0;
}-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US