By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,686 Members | 1,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,686 IT Pros & Developers. It's quick & easy.

Warning: Unexpected character

P: n/a
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

Nov 22 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
vagos <va***@freemail.gr> wrote:
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


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 !
' `) /
|\_ =="
Nov 22 '05 #2

P: n/a
vagos wrote:
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


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
Nov 22 '05 #3

P: n/a


denisb wrote:
vagos <va***@freemail.gr> wrote:
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

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

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_VARS["member"];
$res = mysql_query("SELECT * FROM members WHERE id = '$u'");
while ($r = mysql_fetch_array($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_epitheto = "Last name";
$lang_main_email = "E-mail";
$lang_main_address = "Address";

Is that a wrong way to write code ??

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


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 !

Nov 22 '05 #4

P: n/a
vagos wrote:
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


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.

Nov 23 '05 #5

P: n/a


Chung Leong wrote:
vagos wrote:
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

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.

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 ???

Nov 24 '05 #6

P: n/a
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.

Nov 24 '05 #7

P: n/a


Chung Leong wrote:
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.


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("SELECT * FROM cat_products WHERE sid = '0'
ORDER BY short ASC");
21.
22. while ($row = mysql_fetch_array($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_lib.php") in my index.php
and no errors will be shown !! (hm, not the needed solution of course)

Dec 2 '05 #8

P: n/a
vagos wrote:


Chung Leong wrote:
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.


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("SELECT * FROM cat_products WHERE sid = '0'
ORDER BY short ASC");
21.
22. while ($row = mysql_fetch_array($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_lib.php") in my index.php
and no errors will be shown !! (hm, not the needed solution of course)


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.
js*******@attglobal.net
==================
Dec 2 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.