unexpected T_STRING

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anne Bos

    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
  • Lammi

    #2
    Re: unexpected T_STRING

    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.

    Comment

    • Shelly

      #3
      Re: unexpected T_STRING


      "Lammi" <Lorenz.Lammers dorf@gmail.comw rote in message
      news:1189509547 .078627.111130@ 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


      Comment

      • Jerry Stuckle

        #4
        Re: unexpected T_STRING

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

        Comment

        • Anne Bos

          #5
          Re: unexpected T_STRING

          On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
          <jstucklex@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

          Comment

          • Good Man

            #6
            Re: unexpected T_STRING

            Anne Bos <anne.bosscha@h ccnet.nlwrote in
            news:93dde31lit f6ag30gtct2a1l8 1lnkq0slt@4ax.c om:
            On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
            <jstucklex@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() ; ?

            Comment

            • Anne Bos

              #7
              Re: unexpected T_STRING

              On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <heyho@letsgo.c om>:
              >Anne Bos <anne.bosscha@h ccnet.nlwrote in
              >news:93dde31li tf6ag30gtct2a1l 81lnkq0slt@4ax. com:
              >
              >On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
              ><jstucklex@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

              Comment

              • Jerry Stuckle

                #8
                Re: unexpected T_STRING

                Anne Bos wrote:
                On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <heyho@letsgo.c om>:
                >
                >Anne Bos <anne.bosscha@h ccnet.nlwrote in
                >news:93dde31li tf6ag30gtct2a1l 81lnkq0slt@4ax. com:
                >>
                >>On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
                >><jstucklex@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.
                jstucklex@attgl obal.net
                =============== ===

                Comment

                • Anne Bos

                  #9
                  Re: unexpected T_STRING

                  On Tue, 11 Sep 2007 12:26:47 -0400 wrote Jerry Stuckle
                  <jstucklex@attg lobal.net>:
                  >Anne Bos wrote:
                  >On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <heyho@letsgo.c om>:
                  >>
                  >>Anne Bos <anne.bosscha@h ccnet.nlwrote in
                  >>news:93dde31l itf6ag30gtct2a1 l81lnkq0slt@4ax .com:
                  >>>
                  >>>On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
                  >>><jstucklex@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()?

                  Comment

                  • Good Man

                    #10
                    Re: unexpected T_STRING

                    Anne Bos <anne.bosscha@h ccnet.nlwrote in
                    news:3i1ee3ppdr min5jnptkfu5lbm 86p42i87b@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?

                    Comment

                    • Juliette

                      #11
                      Re: unexpected T_STRING

                      Anne Bos wrote:
                      On Tue, 11 Sep 2007 12:26:47 -0400 wrote Jerry Stuckle
                      <jstucklex@attg lobal.net>:
                      >
                      >Anne Bos wrote:
                      >>On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <heyho@letsgo.c om>:
                      >>>
                      >>>Anne Bos <anne.bosscha@h ccnet.nlwrote in
                      >>>news:93dde31 litf6ag30gtct2a 1l81lnkq0slt@4a x.com:
                      >>>>
                      >>>>On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
                      >>>><jstucklex@ attglobal.net>:
                      >>>>>
                      >>>>>Anne Bos wrote:
                      >>>>>>After uploading a php file I got back the error message 'unexpected
                      >>>>>>T_STRIN G 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 ;-)

                      Comment

                      • Jerry Stuckle

                        #12
                        Re: unexpected T_STRING

                        Anne Bos wrote:
                        On Tue, 11 Sep 2007 12:26:47 -0400 wrote Jerry Stuckle
                        <jstucklex@attg lobal.net>:
                        >
                        >Anne Bos wrote:
                        >>On Tue, 11 Sep 2007 10:36:14 -0500 wrote Good Man <heyho@letsgo.c om>:
                        >>>
                        >>>Anne Bos <anne.bosscha@h ccnet.nlwrote in
                        >>>news:93dde31 litf6ag30gtct2a 1l81lnkq0slt@4a x.com:
                        >>>>
                        >>>>On Tue, 11 Sep 2007 07:22:57 -0400 wrote Jerry Stuckle
                        >>>><jstucklex@ attglobal.net>:
                        >>>>>
                        >>>>>Anne Bos wrote:
                        >>>>>>After uploading a php file I got back the error message 'unexpected
                        >>>>>>T_STRIN G 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.
                        jstucklex@attgl obal.net
                        =============== ===

                        Comment

                        • Good Man

                          #13
                          Re: unexpected T_STRING

                          Jerry Stuckle <jstucklex@attg lobal.netwrote in
                          news:AKadnV7U3f WkzHrbnZ2dnUVZ_ hudnZ2d@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

                          !!!!!!!

                          Comment

                          • Jerry Stuckle

                            #14
                            Re: unexpected T_STRING

                            Good Man wrote:
                            Jerry Stuckle <jstucklex@attg lobal.netwrote in
                            news:AKadnV7U3f WkzHrbnZ2dnUVZ_ hudnZ2d@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.
                            jstucklex@attgl obal.net
                            =============== ===

                            Comment

                            Working...