terror Posted November 5, 2006 Share Posted November 5, 2006 Error:[code]Parse error: syntax error, unexpected '<' in /home/zack/public_html/rpg/main.php on line 49[/code]Code[code]<? include('header'); ?><?phpinclude('inc/dbconnect.php');$sql = "SELECT * FROM stats WHERE stats.id=$_COOKIE[id]";$res = mysql_query($sql);$sql2 = "SELECT * FROM ability WHERE ability.id=$_COOKIE[id]";$res2 = mysql_query($sql2);$res3 = mysql_fetch_assoc($res);$res4 = mysql_fetch_assoc($res2);$level = $res3[level];$xp = $res3[xp];$xpadd = $res3[xpadd];$health = $res3[health];$outhp = $level * 100;$attack = $res3[attack];$defence = $res3[defence];$fire = $res3[fire];$water = $res3[water];$blizzard = $res3[blizzard];$thunder = $res3[thunder];$mana = $res3[mana];$manaout = $level * 20;if($xpadd == 40){//}else{include('inc/levels.php');};?>Welcome <?=$res3[username]?> to your stats page!<br><br><table border=0 cellspacing=0 cellpadding=2><tr><td>Level:<td><?=$level?>/100<tr><td>Experience:<td><?=$xp?><tr><td>Health:<td><?=$health?>/<?=$outhp?><tr><td>Attack:<td><?=$attack?><tr><td>Defence:<td><?=$defence?><tr><td>Mana:<td><?=$mana?>/<?=$manaout?><tr><td>Magic:<td>if $level < 4;echo:{ "None";}else{if $level >= 4;echo:<?=$fire><?=water><?=blizzard?><?=thunder?></table><? include('footer'); ?>[/code]Iunno whats wrong, someone help. If you wanna help beta test with me the url is rpg.mildrum.net Link to comment https://forums.phpfreaks.com/topic/26238-snytax-error-help-needed/ Share on other sites More sharing options...
almightyegg Posted November 5, 2006 Share Posted November 5, 2006 many things i see: main thing i see is <?=$thing?> should be <? echo $thing ?>AND[code=php:0]Magic:<td>//you need to open php<?//you need to change if statementsif($level < 4){ echo "None";}elseif($level >= 4){echo "$fire $water $blizzard $thunder";?></table><? include('footer'); ?>[/code] Link to comment https://forums.phpfreaks.com/topic/26238-snytax-error-help-needed/#findComment-120023 Share on other sites More sharing options...
terror Posted November 5, 2006 Author Share Posted November 5, 2006 alright ill try it. Link to comment https://forums.phpfreaks.com/topic/26238-snytax-error-help-needed/#findComment-120024 Share on other sites More sharing options...
terror Posted November 5, 2006 Author Share Posted November 5, 2006 nothing just a different error, with your mod to it the new error is [code]Parse error: syntax error, unexpected $end in /home/zack/public_html/rpg/main.php on line 52[/code]and if i fixed the script correctly the new code is [code]<? include('header'); ?><?phpinclude('inc/dbconnect.php');$sql = "SELECT * FROM stats WHERE stats.id=$_COOKIE[id]";$res = mysql_query($sql);$sql2 = "SELECT * FROM ability WHERE ability.id=$_COOKIE[id]";$res2 = mysql_query($sql2);$res3 = mysql_fetch_assoc($res);$res4 = mysql_fetch_assoc($res2);$level = $res3[level];$xp = $res3[xp];$xpadd = $res3[xpadd];$health = $res3[health];$outhp = $level * 100;$attack = $res3[attack];$defence = $res3[defence];$fire = $res3[fire];$water = $res3[water];$blizzard = $res3[blizzard];$thunder = $res3[thunder];$mana = $res3[mana];$manaout = $level * 20;if($xpadd == 40){//}else{include('inc/levels.php');};?>Welcome <?=$res3[username]?> to your stats page!<br><br><table border=0 cellspacing=0 cellpadding=2><tr><td>Level:<td><?=$level?>/100<tr><td>Experience:<td><?=$xp?><tr><td>Health:<td><?=$health?>/<?=$outhp?><tr><td>Attack:<td><?=$attack?><tr><td>Defence:<td><?=$defence?><tr><td>Mana:<td><?=$mana?>/<?=$manaout?><tr><td>Magic:<td><?phpif($level < 4){ echo "None";}elseif($level >= 4){echo "$fire $water $blizzard $thunder";?></table><? include('footer'); ?>[/code] Link to comment https://forums.phpfreaks.com/topic/26238-snytax-error-help-needed/#findComment-120026 Share on other sites More sharing options...
terror Posted November 5, 2006 Author Share Posted November 5, 2006 well there is no error now its just not showing up correctly, try for yourself, rpg.mildrum.net Link to comment https://forums.phpfreaks.com/topic/26238-snytax-error-help-needed/#findComment-120028 Share on other sites More sharing options...
terror Posted November 5, 2006 Author Share Posted November 5, 2006 hey almightyegg do you have msn or aol? if you do ill give you access to my site and you can help me throught the whole rpg Link to comment https://forums.phpfreaks.com/topic/26238-snytax-error-help-needed/#findComment-120030 Share on other sites More sharing options...
almightyegg Posted November 5, 2006 Share Posted November 5, 2006 oops! thats a simple fix :)[code=php:0]<? include('header'); ?><?phpinclude('inc/dbconnect.php');$sql = "SELECT * FROM stats WHERE stats.id=$_COOKIE[id]";$res = mysql_query($sql);$sql2 = "SELECT * FROM ability WHERE ability.id=$_COOKIE[id]";$res2 = mysql_query($sql2);$res3 = mysql_fetch_assoc($res);$res4 = mysql_fetch_assoc($res2);$level = $res3[level];$xp = $res3[xp];$xpadd = $res3[xpadd];$health = $res3[health];$outhp = $level * 100;$attack = $res3[attack];$defence = $res3[defence];$fire = $res3[fire];$water = $res3[water];$blizzard = $res3[blizzard];$thunder = $res3[thunder];$mana = $res3[mana];$manaout = $level * 20;if($xpadd == 40){//}else{include('inc/levels.php');};?>Welcome <? echo $res3[username] ?> to your stats page!<br><br><table border=0 cellspacing=0 cellpadding=2><tr><td>Level:<td><? echo $level ?>/100<tr><td>Experience:<td><? echo $xp ?><tr><td>Health:<td><? echo $health ?>/<? echo $outhp ?><tr><td>Attack:<td><? echo $attack ?><tr><td>Defence:<td><? echo $defence ?><tr><td>Mana:<td><? echo $mana ?>/<? echo $manaout ?><tr><td>Magic:<td><?phpif($level < 4){ echo "None";}elseif($level >= 4){echo "$fire $water $blizzard $thunder";}?></table><? include('footer'); ?>[/code] Link to comment https://forums.phpfreaks.com/topic/26238-snytax-error-help-needed/#findComment-120032 Share on other sites More sharing options...
terror Posted November 5, 2006 Author Share Posted November 5, 2006 YAY IT WORKS! sweet. Thanks man. Link to comment https://forums.phpfreaks.com/topic/26238-snytax-error-help-needed/#findComment-120034 Share on other sites More sharing options...
almightyegg Posted November 5, 2006 Share Posted November 5, 2006 check your PMs ;) Link to comment https://forums.phpfreaks.com/topic/26238-snytax-error-help-needed/#findComment-120036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.