Hi everyone,
I'm still rather new to PHP code, and I have a syntax error. I've tried several different solutions, but it won't fix. It seems to suggest that I need a new bracket somewhere in the offending line, but being amateur, I don't know where. I've tried putting one in several places, to no avail. Clearly, to solve this in a smaller period than a week I need someone with more skill to help out. Heh heh.
The error is:
Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in C:\xampplite\htdocs\BraysideSite\Pages\blog.php on line 11
The following is the offending section of code. Line 11 is the "if $_SESSION" line. -
<?php
-
include("connection.php");
-
if $_SESSION['curr_user'] == '';
-
{
-
//Redirects to login page below
-
header('Location: blog.php');
-
}
-
?>
-
If anyone could help me with this, it'd be much appreciated.
Thanks,
Silva
3 6929
Hi everyone,
I'm still rather new to PHP code, and I have a syntax error. I've tried several different solutions, but it won't fix. It seems to suggest that I need a new bracket somewhere in the offending line, but being amateur, I don't know where. I've tried putting one in several places, to no avail. Clearly, to solve this in a smaller period than a week I need someone with more skill to help out. Heh heh.
The error is:
Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in C:\xampplite\htdocs\BraysideSite\Pages\blog.php on line 11
The following is the offending section of code. Line 11 is the "if $_SESSION" line.
<?php
include("connection.php");
if $_SESSION['curr_user'] == '';
{
//Redirects to login page below
header('Location: blog.php');
}
?>
If anyone could help me with this, it'd be much appreciated.
Thanks,
Silva
Your IF statement needs to be wrapped in ( )
i.e - if ($_SESSION['curr_user'] == '')
-
and you also dont want the semi colon at the end :)
Ahh. I see. I'll try it out.
It works. Thank you very much for your help.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ehartwig |
last post by:
I recently created a script for user verification, solved my emailing
issues, and then re-created the script in order to work well with the
new PHP 5 that I installed on my server. After...
|
by: aamer |
last post by:
can anyone please help me, im getting a dumb:
Parse error: syntax error, unexpected T_VARIABLE in /home/jeddah/public_html/lomar/cart/remove.php on line 5
in the following file,
<?php...
|
by: bovanshi |
last post by:
got this annoying error
I'm completly new to php... and i have no clue what is wrong here, from what i can tell there is nothing rong with this code... but that isn't what the borwser say :P
...
|
by: Anna MZ |
last post by:
I am new to php and have written the following mysql code to enter the details of a new user in the admin subdomain of my website:
$sql = "INSERT INTO 'users' ('userid', 'username', 'upassword')...
|
by: mdouble |
last post by:
I'm a complete novice with HTML and PHP. Recently I purchased an auto responder that requires me to edit a PHP file during the installation process as per directions provided in a read me file.
...
|
by: needhelp08 |
last post by:
I am getting the error Parse error: syntax error, unexpected T_VARIABLE on line 4 but I can't seem to find what is wrong. Could someone please help.
<?php
$conn = @mysql_connect("localhost",...
|
by: praclarush |
last post by:
I've just started php, and this is a class assignment, but my question is I’m getting this error PHP Parse error: syntax error, unexpected T_IF, expecting T_VARIABLE or '$' in...
|
by: fburn |
last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux.
I receive an error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
|
by: broll911 |
last post by:
I am gettin a error message on this script can someone help me. I am a complete newbie on this stuff. Thanks in advance for any help you can give me.
here is the error.
Parse error: syntax error,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| | |