unexpected T_STRING

unexpected T_STRING

am 11.09.2007 13:02:42 von Anne Bos

After uploading a php file I got back the error message 'unexpected
T_STRING on line 1'.
Line 1 is .
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

Re: unexpected T_STRING

am 11.09.2007 13:19:07 von Lammi

On 11 Sep., 13:02, Anne Bos wrote:
> After uploading a php file I got back the error message 'unexpected
> T_STRING on line 1'.
> Line 1 is .
> 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.

Re: unexpected T_STRING

am 11.09.2007 13:22:57 von Jerry Stuckle

Anne Bos wrote:
> After uploading a php file I got back the error message 'unexpected
> T_STRING on line 1'.
> Line 1 is .
> 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.
jstucklex@attglobal.net
==================

Re: unexpected T_STRING

am 11.09.2007 13:28:12 von Shelly

"Lammi" wrote in message
news:1189509547.078627.111130@57g2000hsv.googlegroups.com...
> On 11 Sep., 13:02, Anne Bos wrote:
>> After uploading a php file I got back the error message 'unexpected
>> T_STRING on line 1'.
>> Line 1 is .
>> 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

Re: unexpected T_STRING

am 11.09.2007 13:36:09 von gosha bine

On 11.09.2007 13:02 Anne Bos wrote:
> After uploading a php file I got back the error message 'unexpected
> T_STRING on line 1'.
> Line 1 is .
> 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

Hi Anne

that code is ok, shouldn't be a parse error. Are you sure the error is
in this file?

T_STRING and other T_xxx constants are token names in php parser. They
are documented in "Appendix S. List of Parser Tokens". T_STRING is a
sequence of characters without quotes, for example, in

function foobar () {

"foobar" would be a T_STRING.


--
gosha bine

makrell ~ http://www.tagarga.com/blok/makrell
php done right ;) http://code.google.com/p/pihipi

Re: unexpected T_STRING

am 11.09.2007 17:32:07 von Anne Bos

On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
:

>Anne Bos wrote:
>> After uploading a php file I got back the error message 'unexpected
>> T_STRING on line 1'.
>> Line 1 is .
>> 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
Thank you so far.
Anne

Re: unexpected T_STRING

am 11.09.2007 17:36:14 von Good Man

Anne Bos wrote in
news:93dde31litf6ag30gtct2a1l81lnkq0slt@4ax.com:

> On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
> :
>
>>Anne Bos wrote:
>>> After uploading a php file I got back the error message 'unexpected
>>> T_STRING on line 1'.
>>> Line 1 is .
>>> 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
> Thank you so far.
> Anne
>

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

Re: unexpected T_STRING

am 11.09.2007 17:57:13 von Anne Bos

On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man :

>Anne Bos wrote in
>news:93dde31litf6ag30gtct2a1l81lnkq0slt@4ax.com:
>
>> On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
>> :
>>
>>>Anne Bos wrote:
>>>> After uploading a php file I got back the error message 'unexpected
>>>> T_STRING on line 1'.
>>>> Line 1 is .
>>>> 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
>> Thank you so far.
>> Anne
>>
>
>errr, session_star(); or session_start(); ?

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

Re: unexpected T_STRING

am 11.09.2007 18:26:47 von Jerry Stuckle

Anne Bos wrote:
> On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man :
>
>> Anne Bos wrote in
>> news:93dde31litf6ag30gtct2a1l81lnkq0slt@4ax.com:
>>
>>> On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
>>> :
>>>
>>>> Anne Bos wrote:
>>>>> After uploading a php file I got back the error message 'unexpected
>>>>> T_STRING on line 1'.
>>>>> Line 1 is .
>>>>> 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
>>> 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.
jstucklex@attglobal.net
==================

Re: unexpected T_STRING

am 11.09.2007 23:26:53 von Anne Bos

On Tue, 11 Sep 2007 12:26:47 -0400 wrote Jerry Stuckle
:

>Anne Bos wrote:
>> On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man :
>>
>>> Anne Bos wrote in
>>> news:93dde31litf6ag30gtct2a1l81lnkq0slt@4ax.com:
>>>
>>>> On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
>>>> :
>>>>
>>>>> Anne Bos wrote:
>>>>>> After uploading a php file I got back the error message 'unexpected
>>>>>> T_STRING on line 1'.
>>>>>> Line 1 is .
>>>>>> 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
>>>> 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
$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()?

Re: unexpected T_STRING

am 11.09.2007 23:43:36 von Good Man

Anne Bos wrote in
news:3i1ee3ppdrmin5jnptkfu5lbm86p42i87b@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
> > $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?

Re: unexpected T_STRING

am 12.09.2007 01:52:31 von Juliette

Anne Bos wrote:
> On Tue, 11 Sep 2007 12:26:47 -0400 wrote Jerry Stuckle
> :
>
>> Anne Bos wrote:
>>> On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man :
>>>
>>>> Anne Bos wrote in
>>>> news:93dde31litf6ag30gtct2a1l81lnkq0slt@4ax.com:
>>>>
>>>>> On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
>>>>> :
>>>>>
>>>>>> Anne Bos wrote:
>>>>>>> After uploading a php file I got back the error message 'unexpected
>>>>>>> T_STRING on line 1'.
>>>>>>> Line 1 is .
>>>>>>> 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
>>>>> 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
> > $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 ;-)

Re: unexpected T_STRING

am 12.09.2007 04:37:15 von Jerry Stuckle

Anne Bos wrote:
> On Tue, 11 Sep 2007 12:26:47 -0400 wrote Jerry Stuckle
> :
>
>> Anne Bos wrote:
>>> On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man :
>>>
>>>> Anne Bos wrote in
>>>> news:93dde31litf6ag30gtct2a1l81lnkq0slt@4ax.com:
>>>>
>>>>> On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
>>>>> :
>>>>>
>>>>>> Anne Bos wrote:
>>>>>>> After uploading a php file I got back the error message 'unexpected
>>>>>>> T_STRING on line 1'.
>>>>>>> Line 1 is .
>>>>>>> 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
>>>>> 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
> > $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.
jstucklex@attglobal.net
==================

Re: unexpected T_STRING

am 12.09.2007 05:44:36 von Good Man

Jerry Stuckle wrote in
news:AKadnV7U3fWkzHrbnZ2dnUVZ_hudnZ2d@comcast.com:


>> >> $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
!!!!!!!

Re: unexpected T_STRING

am 12.09.2007 06:08:01 von Jerry Stuckle

Good Man wrote:
> Jerry Stuckle wrote in
> news:AKadnV7U3fWkzHrbnZ2dnUVZ_hudnZ2d@comcast.com:
>
>
>>> >>> $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 >
> !!!!!!!

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.
jstucklex@attglobal.net
==================

Re: unexpected T_STRING

am 12.09.2007 13:18:04 von Anne Bos

On Tue, 11 Sep 2007 13:36:09 +0200 wrote gosha bine
:

>On 11.09.2007 13:02 Anne Bos wrote:
>> After uploading a php file I got back the error message 'unexpected
>> T_STRING on line 1'.
>> Line 1 is .
>> 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
>
>Hi Anne
>
>that code is ok, shouldn't be a parse error. Are you sure the error is
>in this file?
>
>T_STRING and other T_xxx constants are token names in php parser. They
>are documented in "Appendix S. List of Parser Tokens". T_STRING is a
>sequence of characters without quotes, for example, in
>
>function foobar () {
>
>"foobar" would be a T_STRING.

Thank you. The problem is not yet solved, but the hint is to be
followed.
Interesting sites you point at!