yuso6363 Posted September 17, 2010 Share Posted September 17, 2010 I am trying to make an awards page for my website (http://www.bubblemagic.co.cc) and I have no idea what is going wrong. <?php$dbmission = "gumball_50";$mission = "Gumball Grabber";$interactive = 1;$page_title = "$mission";$rank_check = 0;include "header.inc.php";$game=$_GET['game'];print "$openHTML";$missioncomplete = mysql_query("SELECT $dbmission FROM awards WHERE user_id = '$userid'")or die(mysql_error()); $mission_complete = mysql_fetch_array( $missioncomplete );$com_miss = $mission_complete['$dbmission'];$get = mysql_query("SELECT $dbmission FROM awards_earn WHERE user_id = '$userid'")or die(mysql_error()); $gumno = mysql_fetch_array( $get );$gum_no = $gumno['gumball_50'];if ($gum_no >= 50) {if ($com_miss < 2){mysql_query("UPDATE awards SET gumball_50 = '1'WHERE user_id = '$userid'");}}ECHO <<<END<body><br><br><blockquote><h1><font color="#0000FF">Mission 1 - </font><font color="#FF00FF">$mission</font></h1><font color="#FF0000">Mission Requirements:<br><ul> <li>Buy 50 gumballs from the <a href="gumball.php">Gumball Machine</a>.<br> So far you have bought $gum_no.</li></ul></body><?phpif ($com_miss == 1) {echo "<blockquote> <font color='#00FF00'> You have completed the mission! <br> <a href='http://www.bubblemagic.co.cc/aaward_gumball.php?clicked=1'>Click here to claim your reward!</a></font> </blockquote>";}elseif ($com_miss == 2) {echo "<blockquote> <font color='#FF0000'> You have already got your reward for this quest. <br><br> <a href='awards.php'>Click here to go back to the mission select screen</a></blockquote>";}?><br></font></blockquote><?phpEND;print "$closeHTML";?> Help!? Link to comment https://forums.phpfreaks.com/topic/213685-awards-page/ Share on other sites More sharing options...
taquitosensei Posted September 17, 2010 Share Posted September 17, 2010 Let's start with.... What is it supposed to be doing? What is it not doing that it's supposed to? What is it doing that it's not supposed to? Link to comment https://forums.phpfreaks.com/topic/213685-awards-page/#findComment-1112228 Share on other sites More sharing options...
yuso6363 Posted September 17, 2010 Author Share Posted September 17, 2010 ok, it's supposed to be checking whether the user has bought 50 gumballs, then if they have it gives them a link to a reward page; then if they have already got the reward (2 in the database) it tells you that. It is doing this http://www.bubblemagic.co.cc/aaward_gumball.php Link to comment https://forums.phpfreaks.com/topic/213685-awards-page/#findComment-1112242 Share on other sites More sharing options...
Miss_Rebelx Posted September 17, 2010 Share Posted September 17, 2010 Well first off, you closed your body tag in the middle of the text, and then kept loading more to the page. And then you randomly opened PHP tags within the <<<END tags when the point of those tags is to put out HTML. Try changing the end of the code to: ECHO <<<END <body> <br><br><blockquote> <h1><font color="#0000FF">Mission 1 - </font><font color="#FF00FF">$mission</font></h1> <font color="#FF0000">Mission Requirements:<br> <ul> <li>Buy 50 gumballs from the <a href="gumball.php">Gumball Machine</a>.<br> So far you have bought $gum_no.</li> </ul> END; if ($com_miss == 1) { echo "<blockquote> <font color='#00FF00'> You have completed the mission! <br> <a href='http://www.bubblemagic.co.cc/aaward_gumball.php?clicked=1'> Click here to claim your reward!</a></font> </blockquote>"; } elseif ($com_miss == 2) { echo "<blockquote> <font color='#FF0000'> You have already got your reward for this quest. <br><br> <a href='awards.php'>Click here to go back to the mission select screen</a> </blockquote>"; } echo "<br>"; echo "</font>"; echo "</blockquote>"; print "$closeHTML"; ?> I took out the closing </body> tag. I moved around the open and close PHP tags, since you never meant to leave the language in the first place (the whole point of the <<<END tag). I output the last bit of HTML through echo tags. Link to comment https://forums.phpfreaks.com/topic/213685-awards-page/#findComment-1112276 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.