473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

parse error

I'm a newbie and I can't figure out what this error means:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /home/easilyta/public_html/pub/user.php on line 190.

heres a snippet of the code:
if (!isset($_COOKIE['cookie'][id])) {
header("Location:
http://error.easilytaken.com/usererror.php?error=login");
exit;
}
188 mysql_connect("localhost", "username",
"password");
189 mysql_select_db("database");
190 $cookie_idfind = mysql_query("SELECT cookie_id
FROM master WHERE user='$_COOKIE['cookie'][id]'");
191 $cookie_id = mysql_fetch_array($cookie_idfind);
192 if($cookie_id[0] == $_COOKIE['cookie'][auth]){
//
//
print 'hello, world';

basically what this does is takes the cookie[id] (which is the user field in
the db) and cookie[auth] (which is cookie_id in the db) using $_COOKIE and
checks to see if the user has the right authorization number stored in their
computer. any ideas as to why i get this error? the manuals are getting me
nowhere...

Thanks,
Matt
Jul 16 '05 #1
1 3460
"Matt Schroeder" <wn*********@comcast.net> wrote in message news:<wi2Ta.116311$Ph3.14479@sccrnsc04>...
I'm a newbie and I can't figure out what this error means:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /home/easilyta/public_html/pub/user.php on line 190.

heres a snippet of the code:
if (!isset($_COOKIE['cookie'][id])) {
header("Location:
http://error.easilytaken.com/usererror.php?error=login");
exit;
}
188 mysql_connect("localhost", "username",
"password");
189 mysql_select_db("database");
190 $cookie_idfind = mysql_query("SELECT cookie_id
FROM master WHERE user='$_COOKIE['cookie'][id]'");
Your problem is that this line contains two sets of single quotes, one
inside the other, and the start of the second quoted string is being
taken as the end of the first quoted string. I would suggest that you
change your code to the following:-

$id = $_COOKIE['cookie'][id];
.... WHERE user='$id'");

Does this make sense to you?

By the way, when you want to post a new message please select "post a
new message" and not "post a follow-up" as it appears as an answer to
a previous post instead of a new post. The fact that the topic is
similar makes no difference.

Tony Marston
http://www.tonymarston.net/
191 $cookie_id = mysql_fetch_array($cookie_idfind);
192 if($cookie_id[0] == $_COOKIE['cookie'][auth]){
//
//
print 'hello, world';

basically what this does is takes the cookie[id] (which is the user field in
the db) and cookie[auth] (which is cookie_id in the db) using $_COOKIE and
checks to see if the user has the right authorization number stored in their
computer. any ideas as to why i get this error? the manuals are getting me
nowhere...

Thanks,
Matt

Jul 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steven | last post by:
I got a "Parse error: parse error in ..." in this line: if(empty($_POST){ ..... But if I fist assign $ssn=$_POST; and then if(empty($ssn){ ... it is working. Any advice? Thanks in advance.
1
by: H.L Bai | last post by:
hi, everybody i meet a parse error when i used the xml4c. any proposal is helpful. The error is following .../XMLRegionHandler.h:59 parse error before '*' .../XMLRegionHandler.h:60 parse...
2
by: Vittal | last post by:
Hello All, I am trying to compile my application on Red Hat Linux 8 against gcc 3.2.2. Very first file in application is failing to compile. I tried compiling my application on Linux 7.2...
21
by: BWIGLEY | last post by:
Basically I've just started making a game. So far it makes an array 25 by 20 and tries to make five rooms within it. In scr_make_room() there's parse errors: 20 C:\c\Rooms\Untitled1.c parse error...
6
by: trevor | last post by:
Incorrect values when using float.Parse(string) I have discovered a problem with float.Parse(string) not getting values exactly correct in some circumstances(CSV file source) but in very similar...
5
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C++ programming. FYI Although I have called...
1
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming. FYI Although I have called this...
1
by: Phaelle | last post by:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' What does that error mean? I canīt find the mistake!! In another script, I have got another kind of mistake : parse...
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
5
by: goldtech | last post by:
SAX XML Parse Python error message Hi, My first attempt at SAX, but have an error message I need help with. I cite the error message, code, and xml below. Be grateful if anyone can tell me...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.