Warning: Unexpected character

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

    Warning: Unexpected character

    Can someone please tell me why i get the following error ??
    The strange is that sometimes i get the error and sometimes not !!
    Also there is no syntax error on line 251


    Warning: Unexpected character in input: ' in
    /usr/local/apache/htdocs/functions.php on line 251

    Thanks,
    Vagos

  • denisb

    #2
    Re: Warning: Unexpected character

    vagos <vagos@freemail .gr> wrote:[color=blue]
    > Can someone please tell me why i get the following error ??
    > The strange is that sometimes i get the error and sometimes not !!
    > Also there is no syntax error on line 251
    > Warning: Unexpected character in input: ' in
    > /usr/local/apache/htdocs/functions.php on line 251[/color]

    is there a variable in your line 251 ($_REQUEST['variable'] maybe)
    or in line 250 ?

    does this variable contain **sometimes** an ' ?

    --
    @@@@@
    E -00 comme on est very beaux dis !
    ' `) /
    |\_ =="

    Comment

    • Disco Octopus

      #3
      Re: Warning: Unexpected character

      vagos wrote:
      [color=blue]
      > Can someone please tell me why i get the following error ??
      > The strange is that sometimes i get the error and sometimes not !!
      > Also there is no syntax error on line 251
      >
      >
      > Warning: Unexpected character in input: ' in
      > /usr/local/apache/htdocs/functions.php on line 251
      >
      > Thanks,
      > Vagos[/color]

      Can you send us the contents of line 251 (and a few surrounding lines)?



      --
      talk to the teacher now and then about something other than the subject
      a beef jerky web site : http://www.choicebeefjerky.com.au
      teach the kids how to ride a skate board, then learn yourself

      Comment

      • vagos

        #4
        Re: Warning: Unexpected character



        denisb wrote:[color=blue]
        > vagos <vagos@freemail .gr> wrote:
        >[color=green]
        >>Can someone please tell me why i get the following error ??
        >>The strange is that sometimes i get the error and sometimes not !!
        >>Also there is no syntax error on line 251
        >>Warning: Unexpected character in input: ' in
        >>/usr/local/apache/htdocs/functions.php on line 251[/color]
        >
        >
        > is there a variable in your line 251 ($_REQUEST['variable'] maybe)
        > or in line 250 ?
        >[/color]
        I do not get the same error every time.
        Sometimes i get an error in functions.php, sometimes in select_lang.php
        config.php etc, in diferent line every time.
        The last 10 minutes, i reloaded my site 50 times and i did not get any
        error !

        This is an example of my members.php

        $u = $HTTP_COOKIE_VA RS["member"];
        $res = mysql_query("SE LECT * FROM members WHERE id = '$u'");
        while ($r = mysql_fetch_arr ay($result))
        {
        $name = $r["name"];
        $epitheto = $r["last_name"];
        $email = $r["email"];
        $address = $r["address"];
        }

        this is an example of lang.php

        $lang_main_name = "Name";
        $lang_main_epit heto = "Last name";
        $lang_main_emai l = "E-mail";
        $lang_main_addr ess = "Address";

        Is that a wrong way to write code ??

        Thanks
        Vagos[color=blue]
        > does this variable contain **sometimes** an ' ?
        >[/color]

        If i always get an error, i have to correct my code in xxx line.
        Now, i get an error in functions.php line 251, reload page and get error
        in config.php line 50, reload page and NO error !

        Comment

        • Chung Leong

          #5
          Re: Warning: Unexpected character

          vagos wrote:[color=blue]
          > Can someone please tell me why i get the following error ??
          > The strange is that sometimes i get the error and sometimes not !!
          > Also there is no syntax error on line 251
          >
          >
          > Warning: Unexpected character in input: ' in
          > /usr/local/apache/htdocs/functions.php on line 251
          >
          > Thanks,
          > Vagos[/color]

          That error is emitted by the PHP parser. Maybe you left your FTP agent
          on or something, and the file was still being uploaded just as you're
          accessing the page.

          Comment

          • vagos

            #6
            Re: Warning: Unexpected character



            Chung Leong wrote:[color=blue]
            > vagos wrote:
            >[color=green]
            >>Can someone please tell me why i get the following error ??
            >>The strange is that sometimes i get the error and sometimes not !!
            >>Also there is no syntax error on line 251
            >>
            >>
            >>Warning: Unexpected character in input: ' in
            >>/usr/local/apache/htdocs/functions.php on line 251
            >>
            >>Thanks,
            >>Vagos[/color]
            >
            >
            > That error is emitted by the PHP parser. Maybe you left your FTP agent
            > on or something, and the file was still being uploaded just as you're
            > accessing the page.
            >[/color]
            Yes, it looks like that. But i did not leave my Ftp agent on.
            Two days now, and i did not get any errors.
            I do not think that the problem is in the code. I think it is something
            else.
            I am not an advanced php programmer, but let me ask this:
            Is it posible that a large file or function with lots of 'ifs' to cause
            that errors ??? Maybe at a moment that the web server is a little more
            busy ???

            Comment

            • Chung Leong

              #7
              Re: Warning: Unexpected character

              Well, if it's not happening any more, then it's probably a transcient
              error of some sort. Maybe the server administrator was doing a file
              restore. Or maybe the disk drive was experiencing problems. It's highly
              unlikely that the error was caused by large PHP files.

              Comment

              • vagos

                #8
                Re: Warning: Unexpected character



                Chung Leong wrote:[color=blue]
                > Well, if it's not happening any more, then it's probably a transcient
                > error of some sort. Maybe the server administrator was doing a file
                > restore. Or maybe the disk drive was experiencing problems. It's highly
                > unlikely that the error was caused by large PHP files.
                >[/color]

                Sorry, but i am still getting those errors

                Warning: Unexpected character in input: ' in
                /usr/local/apache/htdocs/super/lib/mod_lib.php on line 20

                ....
                18. if ($mod == "in_m1") {
                19. $main2 .= "<table width=100% border=0 cellpadding=\"1 \"
                cellspacing=\"1 \">";
                20. $result = mysql_query("SE LECT * FROM cat_products WHERE sid = '0'
                ORDER BY short ASC");
                21.
                22. while ($row = mysql_fetch_arr ay($result))
                ....

                This time i get error in a different file.
                The strange is that web page is shown correctlly (exept the first line
                writting the error)

                The only solution i found is to @include("mod_l ib.php") in my index.php
                and no errors will be shown !! (hm, not the needed solution of course)

                Comment

                • Jerry Stuckle

                  #9
                  Re: Warning: Unexpected character

                  vagos wrote:[color=blue]
                  >
                  >
                  > Chung Leong wrote:
                  >[color=green]
                  >> Well, if it's not happening any more, then it's probably a transcient
                  >> error of some sort. Maybe the server administrator was doing a file
                  >> restore. Or maybe the disk drive was experiencing problems. It's highly
                  >> unlikely that the error was caused by large PHP files.
                  >>[/color]
                  >
                  > Sorry, but i am still getting those errors
                  >
                  > Warning: Unexpected character in input: ' in
                  > /usr/local/apache/htdocs/super/lib/mod_lib.php on line 20
                  >
                  > ...
                  > 18. if ($mod == "in_m1") {
                  > 19. $main2 .= "<table width=100% border=0 cellpadding=\"1 \"
                  > cellspacing=\"1 \">";
                  > 20. $result = mysql_query("SE LECT * FROM cat_products WHERE sid = '0'
                  > ORDER BY short ASC");
                  > 21.
                  > 22. while ($row = mysql_fetch_arr ay($result))
                  > ...
                  >
                  > This time i get error in a different file.
                  > The strange is that web page is shown correctlly (exept the first line
                  > writting the error)
                  >
                  > The only solution i found is to @include("mod_l ib.php") in my index.php
                  > and no errors will be shown !! (hm, not the needed solution of course)
                  >[/color]

                  Check to see if you have mismatched single quotes (') earlier in your
                  script (or in an included script).

                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  Working...