473,772 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 30576
On 11 Sep., 13:02, Anne Bos <anne.boss...@h ccnet.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.comw rote in message
news:11******** **************@ 57g2000hsv.goog legroups.com...
On 11 Sep., 13:02, Anne Bos <anne.boss...@h ccnet.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*******@attgl obal.net
=============== ===
Sep 11 '07 #4
On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@attg lobal.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**********@h ccnet.nlwrote in
news:93******** *************** *********@4ax.c om:
On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@attg lobal.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.c om>:
>Anne Bos <an**********@h ccnet.nlwrote in
news:93******* *************** **********@4ax. com:
>On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@att global.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.c om>:
>Anne Bos <an**********@h ccnet.nlwrote in
news:93******* *************** **********@4ax. com:
>>On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@at tglobal.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*******@attgl obal.net
=============== ===
Sep 11 '07 #8
On Tue, 11 Sep 2007 12:26:47 -0400 wrote Jerry Stuckle
<js*******@attg lobal.net>:
>Anne Bos wrote:
>On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <he***@letsgo.c om>:
>>Anne Bos <an**********@h ccnet.nlwrote in
news:93****** *************** ***********@4ax .com:

On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
<js*******@a ttglobal.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**********@h ccnet.nlwrote in
news:3i******** *************** *********@4ax.c om:
>>
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

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

Similar topics

2
2887
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 process_card($card_details) { // connect to payment gateway or // use gpg to encrypt and mail or // store in DB if you really want to
2
4086
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 action="sql.php" method="POST"> Name:<input type="text" name="name" maxlength="10"> <br /> <input type="submit" name="submit" value="Submit Data"> And here's sql.php: <?php // Make a MySQL Connection
4
22160
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 if(isset($_GET)) { echo "<div id="visible">"; echo "<span onclick="swapform()">Log In Form</span>"; echo "</div>"; echo "<div id="theform" style="visibility: hidden">";
6
2621
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 that directs to Auth.php. The code for this is below: <?php /* Program: Auth.php * Desc: Program that prompts for a user name and * password from the user using HTTP authentication.
21
8552
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) VALUES ($RecordsetUserID, UPLOAD_DIR.$_SESSION.'/'.$now.$_SESSION.'-'.$file); Can anyone help?
3
2399
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 help?
3
5597
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 what's the actual problem here..? my code
11
2936
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: attachment; header("Pragma: no-cache"); header("Expires; 0"); print "$header\n$data";
0
1808
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 /home/allrail/public_html/header.php:40) in /home/ allrail/public_html/header.php on line 39 as well as this: Fatal error: Cannot redeclare maketr() (previously declared in /home/ allrail/public_html/templates/menu.php.html:24) in /home/allrail/...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10039
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7461
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2851
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.