Warning: Unexpected character in input

brohaz

New Member
Messages
3
Reaction score
0
Points
0
Hi all im have some problems wiht a php file i made.

when i access the script i get the following error message:

Warning: Unexpected character in input: "' (ASCII=39) state=1 in [my dir] on line 63

Parse error: syntax error, unexpected ')' expecting ']' in [my dir] on line 63

the code around there is:

Code:
}else if ($_POST) {
 
if ((!$_POST["topic_id"]) || (!$_POST["post_text']) || (!$_POST["post_owner"])) {
 
header("Location: topiclist.php");
exit;
}

i have manged to fix it im not sure how but now i got anew message saying something about an unexpected ";" on line 65. line 65 is a blank line.
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Try a coloring editor, or use the
PHP:
 tags rather than the [code] tags and you'll see the problem:
[php]}else if ($_POST) {
 
if ((!$_POST["topic_id"]) || (!$_POST["post_text']) || (!$_POST["post_owner"])) {
 
header("Location: topiclist.php");
exit;
}
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
i have manged to fix it im not sure how but now i got anew message saying something about an unexpected ";" on line 65. line 65 is a blank line.

A. If you are using FileManager, use the CodeEditor.
B. Is the code posted the latest after your "fix"?
 

ichwar

Community Advocate
Community Support
Messages
1,454
Reaction score
7
Points
0
Try a coloring editor, or use the
PHP:
 tags rather than the [code] tags and you'll see the problem:
[php]}else if ($_POST) {
 
if ((!$_POST["topic_id"]) || (!$_POST["post_text']) || (!$_POST["post_owner"])) {
 
header("Location: topiclist.php");
exit;
}
Wow, good catch.

Change your code to this brhoz:
PHP:
}else if ($_POST) {
 
if ((!$_POST["topic_id"]) || (!$_POST["post_text"]) || (!$_POST["post_owner"])) {
 
header("Location: topiclist.php");
exit;
}
 
Top