greenbman Posted February 16, 2013 Share Posted February 16, 2013 I have no clue what this error means? Parse error: syntax error, unexpected $end in /home/#####/public_html/buildings.php on line 348 Here is my code: <?php require_once("libfunc/funcvars.php"); /** * @author ############## * @copyright 2013 */ $gi = getSloppyCheeseKing(); if($_SESSION["overall_id"]<=0){ header("location: home.php?strval=5"); } $ui = getSloppyCheese($_SESSION["overall_id"]); $pi = getSloppyCheeseBall($ui['planetID']); $usrnc = number_format($ui['usrnc']); $plntnc = number_format($ui['plntnc']); $pname = anti_injection($pi['PlanetName']); $iron = number_format(anti_injection($pi['Iron_Res'])); $plat = number_format(anti_injection($pi['Plat_Res'])); $energy = number_format(anti_injection($pi['Energy_Res'])); $citizen = number_format(anti_injection($pi['Citizens_Res'])); $title = anti_injection($gi['GameName']); $slogan = anti_injection($gi['Slogan']); if(isset($_GET['strval'])){ $strval = anti_injection($_GET['strval']); } if(isset($_POST['UPGIron'])){ $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = buildOnSloppyCheeseBall(1, $row['ironbaseprice1'], $row['ironbaseprice2'], $row['ironbaseprice3'], $row['ironminelevel'], $ui['planetID'], $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Upgrade Completed!"; } } } if(isset($_POST['UPGPlat'])){ $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = buildOnSloppyCheeseBall(2, $row['platbaseprice1'], $row['platbaseprice2'], $row['platbaseprice3'], $row['platminelevel'], $ui['planetID'], $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Upgrade Completed!"; } } } if(isset($_POST['UPGSolar'])){ $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = buildOnSloppyCheeseBall(3, $row['solarbaseprice1'], $row['solarbaseprice2'], $row['solarbaseprice3'], $row['solarminelevel'], $ui['planetID'], $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Upgrade Completed!"; } } } if(isset($_POST['UPGFusion'])){ $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = buildOnSloppyCheeseBall(4, $row['fusionbaseprice1'], $row['fusionbaseprice2'], $row['fusionbaseprice3'], $row['fusionminelevel'], $ui['planetID'], $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Upgrade Completed!"; } } if(isset($_POST['UPGRecruit'])){ $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = buildOnSloppyCheeseBall(5, $row['recruitbaseprice1'], $row['recruitbaseprice2'], $row['recruitbaseprice3'], $row['recruitminelevel'], $ui['planetID'], $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Upgrade Completed!"; } } } ?> <html> <head> <title>############## </title> <style type="text/css"> body{ background-color:#000000; } #topbar{ position:absolute; width:986px; height:196px; background-image:url("images/IngameHeader.png"); } #navbar{ position:absolute; top:196px; width:986px; height:40px; } #leftnav{ position:absolute; top:236px; left:60px; width:201px; height:940px; background-image:url("images/LeftNav.png"); } #maincontent{ position:absolute; top:236px; left:270px; </style> <script type="text/javascript" language="javascript" src="script.js"></script> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="topbar"> </div> <div id="navbar"> <img src="images/IngameNav.png" width="986" height="40" border="0" alt="" usemap="#IngameNav_Map"> <map name="IngameNav_Map"> <area shape="rect" alt="" coords="770,0,843,40" href="signout.php"> <area shape="rect" alt="" coords="542,0,643,40" href="population.php"> <area shape="rect" alt="" coords="414,0,488,40" href="shipyard.php"> <area shape="rect" alt="" coords="284,0,366,40" href="buildings.php"> <area shape="rect" alt="" coords="168,0,240,40" href="account.php"> </map> </div> <div id="leftnav"> </div> <div id="maincontent"> <img src="src_img/bover.png" id="bover" /> <span class="hotspot1" ><?php if(isset($msg)){?><b><font color='red'><?php print $msg;?></font></b><?php }?></span> <center><img src="src_img/planetary_rec.png" onmouseover="tooltip.show('<center><h3><span><?php print $pname;?></span></h3><b>Iron: <span><?php print $iron;?></span> units<br /></b><b>Platinum: <span><?php print $plat;?></span> units<br /></b><b> Energy: <span><?php print $energy;?></span> units<br /></b><b>Citizen: <span><?php print $citizen;?></span> units<br /></b></center>');" onmouseout="tooltip.hide();" style="cursor:pointer;" /></center> <?php $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $count = mysql_num_rows($res); if($count<=0){ $query = "INSERT INTO `buildings` SET `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); if(isset($res)){ header("location: buildings.php"); } }else{ $buildingsInfo = $row; $ioutput = ($row['ironbaseoutput']*$row['ironminelevel']*700); $poutput = ($row['platbaseoutput']*$row['platminelevel']*700); $eoutput = ($row['solarbaseoutput']*$row['solarminelevel']*10); $feoutput = ($row['fusionbaseoutput']*$row['fusionminelevel']*100); $uuoutput = ($row['recruitbaseoutput']*$row['recruitminelevel']*100); } ?> <form method="POST" action="" name="submit_iron_build"> <div id="IronMine" style="background-image:url('src_img/IronMine.png');width:519px;height:156px;"> <img src="src_img/IM.png" id="IM" onmouseover="tooltip.show('<center><h3><span>Iron Mine</span></h3><b>Iron Produced per cycle: <span><?php echo number_format($ioutput);?></span> units<br /></b></center>');" onmouseout="tooltip.hide();" /> <div id="IIronPrice"><?php if($buildingsInfo['ironminelevel']<=0){ echo number_format($buildingsInfo['ironbaseprice1']);}else{echo number_format($buildingsInfo['ironbaseprice1']*$buildingsInfo['ironminelevel']*200);}?> Units</div> <div id="IPlatinumPrice"><?php if($buildingsInfo['ironminelevel']<=0){ echo number_format($buildingsInfo['ironbaseprice2']);}else{echo number_format($buildingsInfo['ironbaseprice2']*$buildingsInfo['ironminelevel']*200);}?> Units</div> <div id="IEnergyPrice"><?php if($buildingsInfo['ironminelevel']<=0){ echo number_format($buildingsInfo['ironbaseprice3']);}else{echo number_format($buildingsInfo['ironbaseprice3']*$buildingsInfo['ironminelevel']*200);}?> Units</div> <div id="ILevel">(<?php echo number_format($buildingsInfo['ironminelevel']);?>)</div> <div id="UpgradeIronMine" ><input type="submit" name="UPGIron" id="UPGIron" value="" /></div> </div> </form> <form method="POST" action="" name="submit_plat_build"> <div id="PlatMine" style="background-image:url('src_img/PlatinumMine.png');width:519px;height:156px;"> <img src="src_img/PM.png" id="PM" onmouseover="tooltip.show('<center><h3><span>Platinum Mine</span></h3><b>Platinum Produced per cycle: <span><?php echo number_format($poutput);?></span> units<br /></b></center>');" onmouseout="tooltip.hide();" /> <div id="PIronPrice"><?php if($buildingsInfo['platminelevel']<=0){ echo number_format($buildingsInfo['platbaseprice1']);}else{echo number_format($buildingsInfo['platbaseprice1']*$buildingsInfo['platminelevel']*200);}?> Units</div> <div id="PPlatinumPrice"><?php if($buildingsInfo['platminelevel']<=0){ echo number_format($buildingsInfo['platbaseprice2']);}else{echo number_format($buildingsInfo['platbaseprice2']*$buildingsInfo['platminelevel']*200);}?> Units</div> <div id="PEnergyPrice"><?php if($buildingsInfo['platminelevel']<=0){ echo number_format($buildingsInfo['platbaseprice3']);}else{echo number_format($buildingsInfo['platbaseprice3']*$buildingsInfo['platminelevel']*200);}?> Units</div> <div id="PLevel">(<?php echo number_format($buildingsInfo['platminelevel']);?>)</div> <div id="UpgradeIronMine" ><input type="submit" name="UPGPlat" id="UPGPlat" value="" /></div> </div> </form> <form method="POST" action="" name="submit_solar_build"> <div id="SolarMine" style="background-image:url('src_img/SolarPanels.png');width:519px;height:156px;"> <img src="src_img/SP.png" id="SP" onmouseover="tooltip.show('<center><h3><span>Solar Panels</span></h3><b>Energy Produced per cycle: <span><?php echo number_format($eoutput);?></span> units<br /></b></center>');" onmouseout="tooltip.hide();" /> <div id="SIronPrice"><?php if($buildingsInfo['solarminelevel']<=0){ echo number_format($buildingsInfo['solarbaseprice1']);}else{echo number_format($buildingsInfo['solarbaseprice1']*$buildingsInfo['solarminelevel']*200);}?> Units</div> <div id="SPlatinumPrice"><?php if($buildingsInfo['solarminelevel']<=0){ echo number_format($buildingsInfo['solarbaseprice2']);}else{echo number_format($buildingsInfo['solarbaseprice2']*$buildingsInfo['solarminelevel']*200);}?> Units</div> <div id="SEnergyPrice"><?php if($buildingsInfo['solarminelevel']<=0){ echo number_format($buildingsInfo['solarbaseprice3']);}else{echo number_format($buildingsInfo['solarbaseprice3']*$buildingsInfo['solarminelevel']*200);}?> Units</div> <div id="SLevel">(<?php echo number_format($buildingsInfo['solarminelevel']);?>)</div> <div id="UpgradeSolarMine" ><input type="submit" name="UPGSolar" id="UPGSolar" value="" /></div> </div> </form> <?php if($buildingsInfo['solarminelevel']>=15){ ?> <form method="POST" action="" name="submit_fusion_build"> <div id="FusionMine" style="background-image:url('src_img/FusionFacility.png');width:519px;height:156px;" onmouseover="tooltip.show('<center><h3><span>Fusion Facility</span></h3><b>Energy Produced per cycle: <span><?php echo number_format($feoutput);?></span> units<br /></b></center>');" onmouseout="tooltip.hide();"> <div id="FIronPrice"><?php if($buildingsInfo['fusionminelevel']<=0){ echo number_format($buildingsInfo['fusionbaseprice1']);}else{echo number_format($buildingsInfo['fusionbaseprice1']*$buildingsInfo['fusionminelevel']*600);}?> Units</div> <div id="FPlatinumPrice"><?php if($buildingsInfo['fusionminelevel']<=0){ echo number_format($buildingsInfo['fusionbaseprice2']);}else{echo number_format($buildingsInfo['fusionbaseprice2']*$buildingsInfo['fusionminelevel']*600);}?> Units</div> <div id="FEnergyPrice"><?php if($buildingsInfo['fusionminelevel']<=0){ echo number_format($buildingsInfo['fusionbaseprice3']);}else{echo number_format($buildingsInfo['fusionbaseprice3']*$buildingsInfo['fusionminelevel']*600);}?> Units</div> <div id="FLevel">(<?php echo number_format($buildingsInfo['fusionminelevel']);?>)</div> <div id="UpgradeFusionMine" ><input type="submit" name="UPGFusion" id="UPGFusion" value="" /></div> </div> </form> <?}?> <form method="POST" action="" name="submit_recruit_build"> <div id="RecruitMine" style="background-image:url('src_img/RecruitmentCenter.png');width:519px;height:156px;" onmouseover="tooltip.show('<center><h3><span>Recruitment Center</span></h3><b>Unplaced Citizen per cycle: <span><?php echo number_format($uuoutput);?></span> units<br /></b></center>');" onmouseout="tooltip.hide();" > <div id="RIronPrice"><?php if($buildingsInfo['recruitminelevel']<=0){ echo number_format($buildingsInfo['recruitbaseprice1']);}else{echo number_format($buildingsInfo['recruitbaseprice1']*$buildingsInfo['recruitminelevel']*600);}?> Units</div> <div id="RPlatinumPrice"><?php if($buildingsInfo['recruitminelevel']<=0){ echo number_format($buildingsInfo['recruitbaseprice2']);}else{echo number_format($buildingsInfo['recruitbaseprice2']*$buildingsInfo['recruitminelevel']*600);}?> Units</div> <div id="REnergyPrice"><?php if($buildingsInfo['recruitminelevel']<=0){ echo number_format($buildingsInfo['recruitbaseprice3']);}else{echo number_format($buildingsInfo['recruitbaseprice3']*$buildingsInfo['recruitminelevel']*600);}?> Units</div> <div id="RLevel">(<?php echo number_format($buildingsInfo['recruitminelevel']);?>)</div> <div id="UpgradeRecruitMine" ><input type="submit" name="UPGRecruit" id="UPGRecruit" value="" /></div> </div> </form> <form method="POST" action="" name="submit_shipyard_build"> <div id="ShipyardMine" style="background-image:url('src_img/ShipYard.png');valign:center;width:519px;height:156px;"> <div id="ShIronPrice"><?php echo number_format($buildingsInfo['shipyardbaseprice1']);?> Units</div> <div id="ShPlatinumPrice"><?php echo number_format($buildingsInfo['shipyardbaseprice2']);?> Units</div> <div id="ShEnergyPrice"><?php echo number_format($buildingsInfo['shipyardbaseprice3']);?> Units</div> <div id="ShLevel">(<?php echo number_format($buildingsInfo['shipyardminelevel']);?>)</div> <div id="UpgradeShipyardMine" ><input type="submit" name="UPGShipyard" id="UPGShipyard" value="" /></div> </div> </form> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/274557-unexpected-end/ Share on other sites More sharing options...
greenbman Posted February 16, 2013 Author Share Posted February 16, 2013 Well due to Google I have figured out my Problem it was a "}" from line 121 I added it and now this works thanks for the views greenbman Quote Link to comment https://forums.phpfreaks.com/topic/274557-unexpected-end/#findComment-1412757 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.