PHP parse error

krahny

New Member
Messages
25
Reaction score
0
Points
0
I have a php page and when I try to load it, this error appears:

Parse error: syntax error, unexpected $end in /home/krahny/public_html/index.php on line 86

This doesn't make any sense to me, since line 86 is the last line, with the </html> tag.

Could someone please help me?

Thanks!
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Unless you post all the code on the page it is hard to tell, but:

1. Missing closing ?> tag
2. Missing closing quotes on some string

The error message is saying that it hit the end of the page expecting "more", with "more" being a closing quote, ) , } , or ?> from the PHP part of the page.
 
Last edited:

krahny

New Member
Messages
25
Reaction score
0
Points
0
Thanks, I forgot to end an else block.

Now I have another error that I don't know what means:

Parse error: syntax error, unexpected T_IF in /home/krahny/public_html/index.php on line 71

Here's the php code, starting on line 61:

61: <?php
62:
63: if(isset($_POST['username'])){
64: if($error!=""){
65: echo $error;
66: }else{
67: echo "Hello " . $_SESSION['logging'] . "!<br/><br/>";
68: }
69: }
70: $Result=mysql_query("SELECT * FROM AllUsers WHERE userName='$_POST[username]' AND Administer='Access'");
71: if(mysql_num_rows($Result)==0){
72: echo "This project is currently under progress.<br/>
73: If you are interested in helping with this project and have skills to offer, please click <a>here</a>.<br/>
74: You may register <a href='register.php'>here</a> if you like,and, if you allow notifications, we will send you an email when this project is complete.<br/>
75: For more information, contact us <a href='contact.php'>here</a>.";
76: }else{
77: echo "Welcome Administrator";
78: }
79: ?>

Thanks!
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Thanks, I forgot to end an else block.

Now I have another error that I don't know what means:

syntax error, unexpected T_IF

Thanks!

It means that the parser found an 'if' where there shouldn't be one. Again, usually means that the problem lies a few lines before that. Missing or additional whatever.
 

krahny

New Member
Messages
25
Reaction score
0
Points
0
Thanks again!

I think I forgot a : at the end of a line.
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
Just to let you know, this line is very unsecure:
70: $Result=mysql_query("SELECT * FROM AllUsers WHERE userName='$_POST[username]' AND Administer='Access'");
You should read this article and follow some of its suggestions.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Top