Nicholas16 Posted July 18, 2009 Share Posted July 18, 2009 hi, im getting this error "Parse error: syntax error, unexpected '<' in /home/a3122898/public_html/index.php on line 207" this is my coding for index.php, can anyone find out the problem for me at all? i dont get it.... <?php $housequery=1; include "globals.php"; print "<h3>General Information:</h2>"; <table><tr><td><b>Name:</b> {$ir['username']}</td><td><b>Knifes:</b> {$cm}</td></tr><tr> <td><b>Level:</b> {$ir['level']}</td> <td><b>Money:</b> $fm</td> <td><b>Hit Points:</b> {$ir['hp']}/{$ir['maxhp']}</td></tr> <tr><td><b>Property:</b> {$ir['hNAME']}</td></tr></table>"; print "<hr><h3>Stats Info:</h3>"; $ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ']; $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); $ir['IQrank']=get_rank($ir['IQ'],'IQ'); $tsrank=get_rank($ts,'strength+agility+guard+labour+IQ'); $ir['strength']=number_format($ir['strength']); $ir['agility']=number_format($ir['agility']); $ir['guard']=number_format($ir['guard']); $ir['labour']=number_format($ir['labour']); $ir['IQ']=number_format($ir['IQ']); $ts=number_format($ts); print "<table><tr><td><b>Strength:</b> {$ir['strength']} [Ranked: {$ir['strank']}]</td><td><b>Agility:</b> {$ir['agility']} [Ranked: {$ir['agirank']}]</td></tr> <tr><td><b>Guard:</b> {$ir['guard']} [Ranked: {$ir['guarank']}]</td><td><b>Labour:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr> <tr><td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td><td><b>Total stats:</b> {$ts} [Ranked: $tsrank]</td></tr></table>"; if(isset($_POST['pn_update'])) { $db->query("UPDATE users SET user_notepad='{$_POST['pn_update']}' WHERE userid=$userid"); $ir['user_notepad']=stripslashes($_POST['pn_update']); print "<hr><b>Personal Notepad Updated!</b>"; } print "<hr>Your Personal Notepad:<form action='index.php' method='post'> <textarea rows='10' cols='50' name='pn_update'>".htmlspecialchars($ir['user_notepad'])."</textarea><br /> <input type='submit' value='Update Notes' /></form>"; $h->endpage(); ?> EDIT: Please use [code][/code] tags. Quote Link to comment Share on other sites More sharing options...
zq29 Posted July 18, 2009 Share Posted July 18, 2009 By using the code tags, and seeing the syntax highlighting above, you should be able to figure it out... Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted July 18, 2009 Share Posted July 18, 2009 Can you please tell us, which is line 207. Quote Link to comment Share on other sites More sharing options...
Nicholas16 Posted July 18, 2009 Author Share Posted July 18, 2009 nope i cant figure it out, i dont know what it means by "on line 207" what does it mean? Quote Link to comment Share on other sites More sharing options...
zq29 Posted July 18, 2009 Share Posted July 18, 2009 nope i cant figure it out, i dont know what it means by "on line 207" what does it mean? It means the error is on, or close to, line 207 of your code. The error can be resolved by reviewing line 4 of the code that you have posted, though. Quote Link to comment Share on other sites More sharing options...
Nicholas16 Posted July 18, 2009 Author Share Posted July 18, 2009 nope i cant figure it out, i dont know what it means by "on line 207" what does it mean? It means the error is on, or close to, line 207 of your code. The error can be resolved by reviewing line 4 of the code that you have posted, though. so 4 lines down, is line 207? does "on line 207" mean 207 letters down then? Quote Link to comment Share on other sites More sharing options...
zq29 Posted July 19, 2009 Share Posted July 19, 2009 No, it means 207 lines down. If that is actually the contents of your whole file I guess it is taking the lines inside your included globals.php file into consideration too. The error you are experiencing is being caused by this: print "<h3>General Information:</h2>"; Change it to this: print "<h3>General Information:</h3> I have removed the double quote and semi-colon that terminate the line. I have also fixed an error in your HTML. Quote Link to comment Share on other sites More sharing options...
Nicholas16 Posted July 19, 2009 Author Share Posted July 19, 2009 sorry about this, the line 207 is fixed now. thanks SemiApocalptic. but erm now i get another error in index.php lol... just my luck really... there is probably more errors on index.php, ill probably ask for more help on this post if there is any more errors :-\ anyways this is what it say: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/a3122898/public_html/index.php on line 215 <?php $housequery=1; include "globals.php"; print "<h2>General Information:</h2> <table><tr> <td><b>Name:</b> {$ir['username']}</td> <td><b>Knifes:</b> {$cm}</td></tr><tr> <td><b>Level:</b> {$ir['level']}</td> <td><b>Money:</b> $fm</td> <td><b>Hit Points:</b> {$ir['hp']}/{$ir['maxhp']}</td></tr><tr> <td><b>Property:</b> {$ir['hNAME']}</td></tr></table>"; print "<h2>Stats Information:</h2> $ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ']; $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); $ir['IQrank']=get_rank($ir['IQ'],'IQ'); $tsrank=get_rank($ts,'strength+agility+guard+labour+IQ'); $ir['strength']=number_format($ir['strength']); $ir['agility']=number_format($ir['agility']); $ir['guard']=number_format($ir['guard']); $ir['labour']=number_format($ir['labour']); $ir['IQ']=number_format($ir['IQ']); $ts=number_format($ts); print "<table><tr> <td><b>Strength:</b> {$ir['strength']} [Ranked: {$ir['strank']}]</td> <td><b>Agility:</b> {$ir['agility']} [Ranked: {$ir['agirank']}]</td></tr><tr> <td><b>Guard:</b> {$ir['guard']} [Ranked: {$ir['guarank']}]</td> <td><b>Labour:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr><tr> <td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td> <td><b>Total stats:</b> {$ts} [Ranked: $tsrank]</td></tr></table>"; $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
Bendude14 Posted July 19, 2009 Share Posted July 19, 2009 this line needed a double quote and a semi-colon print "<h2>Stats Information:</h2> print "<h2>Stats Information:</h2>"; Quote Link to comment Share on other sites More sharing options...
Nicholas16 Posted July 19, 2009 Author Share Posted July 19, 2009 thanks Bendude14, im just wondering... i keep on getting errors for this stupid index.php lol, now its line 304... can someone just recode it all and post it on here please? it would help out alot. and hopefully wouldnt need to post on here about what line the error is on in index.php. it would be greatful if someone can spend a little bit of time and recode it so its all right? and wont have any errors. Quote Link to comment Share on other sites More sharing options...
Nicholas16 Posted July 19, 2009 Author Share Posted July 19, 2009 thanks Bendude14, im just wondering... i keep on getting errors for this stupid index.php lol, now its line 304... can someone just recode it all and post it on here please? it would help out alot. and hopefully wouldnt need to post on here about what line the error is on in index.php. it would be greatful if someone can spend a little bit of time and recode it so its all right? and wont have any errors. sorry this is the coding ive got lol <?php $housequery=1; include "globals.php"; print "<h2>General Information:</h2> <table><tr> <td><b>Name:</b> {$ir['username']}</td> <td><b>Knifes:</b> {$cm}</td></tr><tr> <td><b>Level:</b> {$ir['level']}</td> <td><b>Money:</b> $fm</td> <td><b>Hit Points:</b> {$ir['hp']}/{$ir['maxhp']}</td></tr><tr> <td><b>Property:</b> {$ir['hNAME']}</td></tr></table>"; print "<h2>Stats Information:</h2>"; $ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ']; $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); $ir['IQrank']=get_rank($ir['IQ'],'IQ'); $tsrank=get_rank($ts,'strength+agility+guard+labour+IQ'); $ir['strength']=number_format($ir['strength']); $ir['agility']=number_format($ir['agility']); $ir['guard']=number_format($ir['guard']); $ir['labour']=number_format($ir['labour']); $ir['IQ']=number_format($ir['IQ']); $ts=number_format($ts); print "<table><tr><td><b>Strength:</b> {$ir['strength']} [Ranked: {$ir['strank']}]</td><td><b>Agility:</b> {$ir['agility']} [Ranked: {$ir['agirank']}]</td></tr> <tr><td><b>Guard:</b> {$ir['guard']} [Ranked: {$ir['guarank']}]</td><td><b>Labour:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr> <tr><td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td><td><b>Total stats:</b> {$ts} [Ranked: $tsrank]</td></tr></table>"; if(isset($_POST['pn_update'])) { $db->query("UPDATE users SET user_notepad='{$_POST['pn_update']}' WHERE userid=$userid"); $ir['user_notepad']=stripslashes($_POST['pn_update']); print "<hr><b>Personal Notepad Updated!</b>"; } print "<hr>Your Personal Notepad:<form action='index.php' method='post'> <textarea rows='10' cols='100' name='pn_update'>".htmlspecialchars($ir['user_notepad'])."</textarea><br /> <input type='submit' value='Update Notes' /></form>"; $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
stelthius Posted July 19, 2009 Share Posted July 19, 2009 This should work now, you need to be more carefull when writing code it really isnt a hard problem to resolve <?php $housequery=1; require_once("globals.php"); // you cant just require it print "<h2>General Information:</h2> <table><tr> <td><b>Name:</b> {$ir['username']}</td> <td><b>Knifes:</b> {$cm}</td></tr><tr> <td><b>Level:</b> {$ir['level']}</td> <td><b>Money:</b> $fm</td> <td><b>Hit Points:</b> {$ir['hp']}/{$ir['maxhp']}</td></tr><tr> <td><b>Property:</b> {$ir['hNAME']}</td></tr></table>"; print "<h2>Stats Information:</h2>"; // "; was missing $ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ']; $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); $ir['IQrank']=get_rank($ir['IQ'],'IQ'); $tsrank=get_rank($ts,'strength+agility+guard+labour+IQ'); $ir['strength']=number_format($ir['strength']); $ir['agility']=number_format($ir['agility']); $ir['guard']=number_format($ir['guard']); $ir['labour']=number_format($ir['labour']); $ir['IQ']=number_format($ir['IQ']); $ts=number_format($ts); print "<table><tr> <td><b>Strength:</b> {$ir['strength']} [Ranked: {$ir['strank']}]</td> <td><b>Agility:</b> {$ir['agility']} [Ranked: {$ir['agirank']}]</td></tr><tr> <td><b>Guard:</b> {$ir['guard']} [Ranked: {$ir['guarank']}]</td> <td><b>Labour:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr><tr> <td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td> <td><b>Total stats:</b> {$ts} [Ranked: $tsrank]</td></tr></table>"; // "; was missing $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
Nicholas16 Posted July 19, 2009 Author Share Posted July 19, 2009 what do you mean "you cant just require it"? btw am i meant to delete the // ??? bits on the codings? or am i meant to add //"; to them parts you told me? Quote Link to comment Share on other sites More sharing options...
zq29 Posted July 19, 2009 Share Posted July 19, 2009 Nicholas16, I think you would benefit from learning the basics of the language before jumping into things. Two forward slashes denote the start of a comment, and does not get processed by the PHP interpreter. You can leave notes throughout your code using this concept. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.