473,405 Members | 2,421 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,405 software developers and data experts.

unexpected T_STRING

After uploading a php file I got back the error message 'unexpected
T_STRING on line 1'.
Line 1 is <?php session_start() ?>.
The servers php version is 5.2.1.

By the way, what is a T_STRING. I can't find that on php sites.

Any suggestion is appreciated.
Anne Bos
Sep 11 '07 #1
13 30534
On 11 Sep., 13:02, Anne Bos <anne.boss...@hccnet.nlwrote:
After uploading a php file I got back the error message 'unexpected
T_STRING on line 1'.
Line 1 is <?php session_start() ?>.
The servers php version is 5.2.1.

By the way, what is a T_STRING. I can't find that on php sites.

Any suggestion is appreciated.
Anne Bos
try adding a ; behind session_start().
T_STRING means, that the parser found a string instead of whatever it
expected. i don't know why it's called T_STRING.

Sep 11 '07 #2

"Lammi" <Lo****************@gmail.comwrote in message
news:11**********************@57g2000hsv.googlegro ups.com...
On 11 Sep., 13:02, Anne Bos <anne.boss...@hccnet.nlwrote:
>After uploading a php file I got back the error message 'unexpected
T_STRING on line 1'.
Line 1 is <?php session_start() ?>.
The servers php version is 5.2.1.

By the way, what is a T_STRING. I can't find that on php sites.

Any suggestion is appreciated.
Anne Bos

try adding a ; behind session_start().
T_STRING means, that the parser found a string instead of whatever it
expected. i don't know why it's called T_STRING.
A common reason for this is that you left off the semi-colon at the end of
the previous sentence. (This has happened to me more frequently lately as I
have bouncing between VB.NET and PHP development :-) )

--
Shelly
Sep 11 '07 #3
Anne Bos wrote:
After uploading a php file I got back the error message 'unexpected
T_STRING on line 1'.
Line 1 is <?php session_start() ?>.
The servers php version is 5.2.1.

By the way, what is a T_STRING. I can't find that on php sites.

Any suggestion is appreciated.
Anne Bos
Aren't you missing something - like maybe a semicolon? :-)

T_STRING AFAIK is just a non-operator, non-numeric value. I've never
seen a definition of it, either - but never really looked for it. Too
many years coding C/C++ - I'm use to cryptic messages :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 11 '07 #4
On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@attglobal.net>:
>Anne Bos wrote:
>After uploading a php file I got back the error message 'unexpected
T_STRING on line 1'.
Line 1 is <?php session_start() ?>.
The servers php version is 5.2.1.

By the way, what is a T_STRING. I can't find that on php sites.

Any suggestion is appreciated.
Anne Bos

Aren't you missing something - like maybe a semicolon? :-)

T_STRING AFAIK is just a non-operator, non-numeric value. I've never
seen a definition of it, either - but never really looked for it. Too
many years coding C/C++ - I'm use to cryptic messages :-)
Sorry, the ; is there. I should have copypasted.
So line 1 is <?php session_star(); ?>
Thank you so far.
Anne
Sep 11 '07 #5
Anne Bos <an**********@hccnet.nlwrote in
news:93********************************@4ax.com:
On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@attglobal.net>:
>>Anne Bos wrote:
>>After uploading a php file I got back the error message 'unexpected
T_STRING on line 1'.
Line 1 is <?php session_start() ?>.
The servers php version is 5.2.1.

By the way, what is a T_STRING. I can't find that on php sites.

Any suggestion is appreciated.
Anne Bos

Aren't you missing something - like maybe a semicolon? :-)

T_STRING AFAIK is just a non-operator, non-numeric value. I've never
seen a definition of it, either - but never really looked for it. Too
many years coding C/C++ - I'm use to cryptic messages :-)

Sorry, the ; is there. I should have copypasted.
So line 1 is <?php session_star(); ?>
Thank you so far.
Anne
errr, session_star(); or session_start(); ?
Sep 11 '07 #6
On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <he***@letsgo.com>:
>Anne Bos <an**********@hccnet.nlwrote in
news:93********************************@4ax.com :
>On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@attglobal.net>:
>>>Anne Bos wrote:
After uploading a php file I got back the error message 'unexpected
T_STRING on line 1'.
Line 1 is <?php session_start() ?>.
The servers php version is 5.2.1.

By the way, what is a T_STRING. I can't find that on php sites.

Any suggestion is appreciated.
Anne Bos

Aren't you missing something - like maybe a semicolon? :-)

T_STRING AFAIK is just a non-operator, non-numeric value. I've never
seen a definition of it, either - but never really looked for it. Too
many years coding C/C++ - I'm use to cryptic messages :-)

Sorry, the ; is there. I should have copypasted.
So line 1 is <?php session_star(); ?>
Thank you so far.
Anne

errr, session_star(); or session_start(); ?
Stupid me. session_start(); of course.
Sorry again.
Anne
Sep 11 '07 #7
Anne Bos wrote:
On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <he***@letsgo.com>:
>Anne Bos <an**********@hccnet.nlwrote in
news:93********************************@4ax.com :
>>On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@attglobal.net>:

Anne Bos wrote:
After uploading a php file I got back the error message 'unexpected
T_STRING on line 1'.
Line 1 is <?php session_start() ?>.
The servers php version is 5.2.1.
>
By the way, what is a T_STRING. I can't find that on php sites.
>
Any suggestion is appreciated.
Anne Bos
Aren't you missing something - like maybe a semicolon? :-)

T_STRING AFAIK is just a non-operator, non-numeric value. I've never
seen a definition of it, either - but never really looked for it. Too
many years coding C/C++ - I'm use to cryptic messages :-)
Sorry, the ; is there. I should have copypasted.
So line 1 is <?php session_star(); ?>
Thank you so far.
Anne
errr, session_star(); or session_start(); ?

Stupid me. session_start(); of course.
Sorry again.
Anne
This shouldn't cause the error you indicate. Is this the first thing in
your page? (It looks like it - but I have to ask).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 11 '07 #8
On Tue, 11 Sep 2007 12:26:47 -0400 wrote Jerry Stuckle
<js*******@attglobal.net>:
>Anne Bos wrote:
>On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <he***@letsgo.com>:
>>Anne Bos <an**********@hccnet.nlwrote in
news:93********************************@4ax.co m:

On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@attglobal.net>:

Anne Bos wrote:
>After uploading a php file I got back the error message 'unexpected
>T_STRING on line 1'.
>Line 1 is <?php session_start() ?>.
>The servers php version is 5.2.1.
>>
>By the way, what is a T_STRING. I can't find that on php sites.
>>
>Any suggestion is appreciated.
>Anne Bos
Aren't you missing something - like maybe a semicolon? :-)
>
T_STRING AFAIK is just a non-operator, non-numeric value. I've never
seen a definition of it, either - but never really looked for it. Too
many years coding C/C++ - I'm use to cryptic messages :-)
Sorry, the ; is there. I should have copypasted.
So line 1 is <?php session_star(); ?>
Thank you so far.
Anne

errr, session_star(); or session_start(); ?

Stupid me. session_start(); of course.
Sorry again.
Anne

This shouldn't cause the error you indicate. Is this the first thing in
your page? (It looks like it - but I have to ask).
Yes, it is
Then the head of a html-code (some 70 lines)
The body also first contains some html
then follows
<? php
$conn = connect();
$showrecs = 15;
$pagerange = 10;
and a lot more.
If the error is not in line 1 it should be here I guess.
Should I have a closer look to the function connect()?

Sep 11 '07 #9
Anne Bos <an**********@hccnet.nlwrote in
news:3i********************************@4ax.com:
>>
This shouldn't cause the error you indicate. Is this the first thing
in your page? (It looks like it - but I have to ask).

Yes, it is
Then the head of a html-code (some 70 lines)
The body also first contains some html
then follows
<? php
$conn = connect();
$showrecs = 15;
$pagerange = 10;
and a lot more.
If the error is not in line 1 it should be here I guess.
Should I have a closer look to the function connect()?
Probably... what the heck is it?
Sep 11 '07 #10
Anne Bos wrote:
On Tue, 11 Sep 2007 12:26:47 -0400 wrote Jerry Stuckle
<js*******@attglobal.net>:
>Anne Bos wrote:
>>On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <he***@letsgo.com>:

Anne Bos <an**********@hccnet.nlwrote in
news:93********************************@4ax.com :

On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@attglobal.net>:
>
>Anne Bos wrote:
>>After uploading a php file I got back the error message 'unexpected
>>T_STRING on line 1'.
>>Line 1 is <?php session_start() ?>.
>>The servers php version is 5.2.1.
>>>
>>By the way, what is a T_STRING. I can't find that on php sites.
>>>
>>Any suggestion is appreciated.
>>Anne Bos
>Aren't you missing something - like maybe a semicolon? :-)
>>
>T_STRING AFAIK is just a non-operator, non-numeric value. I've never
>seen a definition of it, either - but never really looked for it. Too
>many years coding C/C++ - I'm use to cryptic messages :-)
Sorry, the ; is there. I should have copypasted.
So line 1 is <?php session_star(); ?>
Thank you so far.
Anne
>
errr, session_star(); or session_start(); ?
Stupid me. session_start(); of course.
Sorry again.
Anne
This shouldn't cause the error you indicate. Is this the first thing in
your page? (It looks like it - but I have to ask).

Yes, it is
Then the head of a html-code (some 70 lines)
The body also first contains some html
then follows
<? php
$conn = connect();
$showrecs = 15;
$pagerange = 10;
and a lot more.
If the error is not in line 1 it should be here I guess.
Should I have a closer look to the function connect()?

If this second snippet is copy-paste:
try removing the space between the ? and php ;-)
Sep 11 '07 #11
Anne Bos wrote:
On Tue, 11 Sep 2007 12:26:47 -0400 wrote Jerry Stuckle
<js*******@attglobal.net>:
>Anne Bos wrote:
>>On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <he***@letsgo.com>:

Anne Bos <an**********@hccnet.nlwrote in
news:93********************************@4ax.com :

On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@attglobal.net>:
>
>Anne Bos wrote:
>>After uploading a php file I got back the error message 'unexpected
>>T_STRING on line 1'.
>>Line 1 is <?php session_start() ?>.
>>The servers php version is 5.2.1.
>>>
>>By the way, what is a T_STRING. I can't find that on php sites.
>>>
>>Any suggestion is appreciated.
>>Anne Bos
>Aren't you missing something - like maybe a semicolon? :-)
>>
>T_STRING AFAIK is just a non-operator, non-numeric value. I've never
>seen a definition of it, either - but never really looked for it. Too
>many years coding C/C++ - I'm use to cryptic messages :-)
Sorry, the ; is there. I should have copypasted.
So line 1 is <?php session_star(); ?>
Thank you so far.
Anne
>
errr, session_star(); or session_start(); ?
Stupid me. session_start(); of course.
Sorry again.
Anne
This shouldn't cause the error you indicate. Is this the first thing in
your page? (It looks like it - but I have to ask).

Yes, it is
Then the head of a html-code (some 70 lines)
The body also first contains some html
then follows
<? php
$conn = connect();
$showrecs = 15;
$pagerange = 10;
and a lot more.
If the error is not in line 1 it should be here I guess.
Should I have a closer look to the function connect()?
This shouldn't cause a problem on line 1. An error may be indicated
later in the file, but not before the error occurs.

Are you sure you copy/pasted this exactly as it appears? Other than the
missing semicolon, there's no problem.

Unless you have some invisible text on there somewhere which isn't pasting.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 12 '07 #12
Jerry Stuckle <js*******@attglobal.netwrote in
news:AK******************************@comcast.com:

><? php
$conn = connect();
$showrecs = 15;
$pagerange = 10;
and a lot more.
If the error is not in line 1 it should be here I guess.
Should I have a closer look to the function connect()?

This shouldn't cause a problem on line 1. An error may be indicated
later in the file, but not before the error occurs.

Are you sure you copy/pasted this exactly as it appears? Other than
the missing semicolon, there's no problem.

Unless you have some invisible text on there somewhere which isn't
pasting.
an eagle-eyed poster noticed the <? php instead of <?php

!!!!!!!
Sep 12 '07 #13
Good Man wrote:
Jerry Stuckle <js*******@attglobal.netwrote in
news:AK******************************@comcast.com:

>><? php
$conn = connect();
$showrecs = 15;
$pagerange = 10;
and a lot more.
If the error is not in line 1 it should be here I guess.
Should I have a closer look to the function connect()?
This shouldn't cause a problem on line 1. An error may be indicated
later in the file, but not before the error occurs.

Are you sure you copy/pasted this exactly as it appears? Other than
the missing semicolon, there's no problem.

Unless you have some invisible text on there somewhere which isn't
pasting.

an eagle-eyed poster noticed the <? php instead of <?php

!!!!!!!
Further down the page. I wouldn't think it should affect line 1,
though. If anything, I would expect it to be just ignored as non-php code.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 12 '07 #14

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

Similar topics

2
by: Salim | last post by:
Hi people, keep getting this errorParse error: parse error, unexpected T_STRING in order_fns.php line 91. the code is below for the file and I've indicated line 91 <?php function...
2
by: movieman21 | last post by:
Hey everyone, I'm new to PHP, and to MySQL. I want this script to allow me to input a value from a form (name) into a MySQL table (test table in test database). Here's the form: <form...
4
kestrel
by: kestrel | last post by:
I have some html code that is supposed to be displayed by php echo. But for some reason i keep getting a syntax error, and i cant figure out what is going on. Heres what i have <?php...
6
by: goodguyjam | last post by:
Hi all, I'm having trouble with mysql. I've just finished my php coding for HTTP authentication and with some help am now getting a login window pop up whenever I click on a link on my website...
21
by: Jordan79 | last post by:
I have uploaded a file and am now trying to store it in a DB. I am getting a "Parse error: syntax error, unexpected T_STRING" error on this line below: INSERT INTO gallery (user_id, image_name) ...
3
by: sclarkstone | last post by:
Im getting this error; Parse error: syntax error, unexpected T_STRING, expecting ':' or ';' with this line; header ('postcodesearch.php?e=nw&pcode=',); I cant find whats wrong, can anyone...
3
paulrajj
by: paulrajj | last post by:
hi to all, i am getting syntax error on my code.. Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Dummy\paulraj\matrim\exam.php on line 62 ...
11
by: JRough | last post by:
I'm trying to use output buffering to cheat so i can print to excel which is called later than this header(). header("Content-type: application/xmsdownload"); header("Content-Disposition:...
0
by: JRough | last post by:
On Sep 26, 3:23 pm, Captain Paralytic <paul_laut...@yahoo.comwrote: without the exit I get this again: Warning: Cannot modify header information - headers already sent by (output started at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
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,...
0
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...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.