Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Unexpected $, what does it mean
moldboy
post Jul 8 2005, 11:59 PM
Post #1


Privileged Member
*********

Group: Members
Posts: 516
Joined: 29-April 05
From: Canada Eh?!?
Member No.: 6,408



You see I have a most intresting problem, basicaly I get the following error:
QUOTE
Parse error: parse error, unexpected $ in /path/result.php on line 99


Now normaly when I have problems I go to line 99 and add a ; or a " or something the problem is in my file line 99 is </html>,
CODE
 <tr bgcolor="#FFFFFF">
   <td width="25" height="5" background="images/q3.png">&nbsp;</td>
   <td height="25" align="right" valign="top" background="images/bot.png"><span class="style2"><a href="help.htm">Help</a></span></td>
   <td width="25" height="25" background="images/q4.png">&nbsp;</td>
 </tr>
</table>
<br>
<span class="style3">a d-gression service</span>
</body>
</html>


Infact the php ended about 20 lines ago on line 79
CODE
?>


Any idea, I can't figure out what the problem might be.
Go to the top of the page
 
+Quote Post
Daehawk
post Jul 9 2005, 12:16 AM
Post #2


Newbie [Level 3]
***

Group: Members
Posts: 43
Joined: 9-June 05
From: TN, USA
Member No.: 8,033



Your problem is that you missed either a } or a ; in one of your previous lines. Find what you edited and look there. I get this now and then and I just check what I did. If you use Word Pad....or something like that...I'm sorry....get Matrix Y2k Website Studios, works wonders on telling you which { is lined up with which }.
Go to the top of the page
 
+Quote Post
moldboy
post Jul 9 2005, 01:23 AM
Post #3


Privileged Member
*********

Group: Members
Posts: 516
Joined: 29-April 05
From: Canada Eh?!?
Member No.: 6,408



Thanks I had a foreach loop inside a while loop and didn't end one of them.
Go to the top of the page
 
+Quote Post
Daehawk
post Jul 9 2005, 06:03 AM
Post #4


Newbie [Level 3]
***

Group: Members
Posts: 43
Joined: 9-June 05
From: TN, USA
Member No.: 8,033



QUOTE(moldboy @ Jul 8 2005, 07:23 PM)
Thanks I had a foreach loop inside a while loop and didn't end one of them.
*





No problem, yeah that's one thing you always have to do is check if you have ended everything.
Go to the top of the page
 
+Quote Post
moldboy
post Jul 9 2005, 06:07 AM
Post #5


Privileged Member
*********

Group: Members
Posts: 516
Joined: 29-April 05
From: Canada Eh?!?
Member No.: 6,408



That and finish every line with ;, you know that is my least favorite thing about PHP. Everytime I forget it. What's even worse is that the error, unexpected something expected , or ;, well if you expected it, then put it there!
Go to the top of the page
 
+Quote Post
Daehawk
post Jul 9 2005, 04:14 PM
Post #6


Newbie [Level 3]
***

Group: Members
Posts: 43
Joined: 9-June 05
From: TN, USA
Member No.: 8,033



QUOTE(moldboy @ Jul 9 2005, 12:07 AM)
That and finish every line with ;, you know that is my least favorite thing about PHP.  Everytime I forget it.  What's even worse is that the error, unexpected something expected , or ;, well if you expected it, then put it there!
*




LoL yeah, I know...I got used to it now though, and it doesn't have to be every line cause some lines you don't need them at the end. like the ones that start if (blah = blah) { and stuff like that LoL.....You get used to it over time.
Go to the top of the page
 
+Quote Post
hype
post Jul 10 2005, 10:03 AM
Post #7


Legend Killer
*********

Group: Members
Posts: 678
Joined: 15-April 05
From: Singapore
Member No.: 5,697



That's what I hate about php, I always miss it out, and mess out my entire code, and wasted my whole day of coding time... I hope there's a machine tat would point out all wrong codes and fixed them automatically for you..
Go to the top of the page
 
+Quote Post
beeseven
post Jul 10 2005, 04:11 PM
Post #8


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



QUOTE(moldboy @ Jul 9 2005, 01:07 AM)
That and finish every line with ;, you know that is my least favorite thing about PHP.  Everytime I forget it.  What's even worse is that the error, unexpected something expected , or ;, well if you expected it, then put it there!
*



Too bad most programming languages require you to finish commands with a semicolon tongue.gif
Go to the top of the page
 
+Quote Post
moldboy
post Jul 10 2005, 04:55 PM
Post #9


Privileged Member
*********

Group: Members
Posts: 516
Joined: 29-April 05
From: Canada Eh?!?
Member No.: 6,408



You know it knows when we are on a new line as it returns the line number that the error is on, yet it can't deduce that we ment to end the line, but then again when you do someting like:
CODE
while(something = somethingelse){
$whole bunch of stuff here;
bunch more stuff
}


the first bunch of stuff could technicaly follow the { and I know most people don't do that, and if it assumed each line break was ; then it would return new errors!
Go to the top of the page
 
+Quote Post
Daehawk