Leveecius Posted November 4, 2009 Share Posted November 4, 2009 Hey guys, this doesn't return any echo's, just refreshes the page :S <? session_start(); if (!(isset($_SESSION["real_name"]))) { //echo "I'm not logged in"; header('Location: index.php'); } else { echo ""; } ?> <html> <head> <title>Mafia Syndicate BETA .::. Bullet Calculator TEST</title></head> <link REL="stylesheet" TYPE="text/css" HREF="main.css"> <script language=javascript src=Menus.js></script> <body background="wallpaper.jpg"> <center> <table border="0" cellspacing="0" cellpadding="0" align="center" width="95%" class="cat"> <TR> <TD width="150" background="tdbg3.jpg" bgcolor="#222222" valign="top"> <?php include("leftmenu.php");?> </TD> <td width="100%" valign="top"> <br> <? if ($bulletcalc==1 || $userlevel >=10){ if (strip_tags($_POST['check']) && strip_tags($_POST['name']) && $bulletcalc==1){ $name = $_POST['name']; $kill_bullets = $_POST['bullets']; $kill_bullets2 = number_format($kill_bullets); $target=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$name'")); $fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); if ($rank == "High School Punk"){ $killerranking="1";} elseif ($rank == "School Bully"){ $killerranking="2";} elseif ($rank == "Gangster"){ $killerranking="3";} elseif ($rank == "Known Gangster"){ $killerranking="4";} elseif ($rank == "Criminal"){ $killerranking="5";} elseif ($rank == "Respected Criminal"){ $killerranking="6";} elseif ($rank == "Gang Leader"){ $killerranking="7";} elseif ($rank == "Crime Boss"){ $killerranking="8";} elseif ($rank == "Assassin"){ $killerranking="9";} elseif ($rank == "Known Assassin"){ $killerranking="10";} elseif ($rank == "Consligere"){ $killerranking="11";} elseif ($rank == "Godfather"){ $killerranking="12";} elseif ($rank == "Don"){ $killerranking="13";} elseif ($rank == "Underboss"){ $killerranking="14";} elseif ($rank == "Boss"){ $killerranking="15";} elseif ($rank == "Family Boss"){ $killerranking="16";} elseif ($rank == "Syndicate Boss"){ $killerranking="17";} if ($target->rank == "High School Punk"){$victimranking="1";} elseif ($target->rank == "School Bully"){$victimranking="2";} elseif ($target->rank == "Gangster"){$victimranking="3";} elseif ($target->rank == "Known Gangster"){$victimranking="4";} elseif ($target->rank == "Criminal"){$victimranking="5";} elseif ($target->rank == "Respected Criminal"){$victimranking="6";} elseif ($target->rank == "Gang Leader"){$victimranking="7";} elseif ($target->rank == "Crime Boss"){$victimranking="8";} elseif ($target->rank == "Assassin"){$victimranking="9";} elseif ($target->rank == "Known Assasin"){$victimranking="10";} elseif ($target->rank == "Consligere"){$victimranking="11";} elseif ($target->rank == "Godfather"){$victimranking="12";} elseif ($target->rank == "Don"){$victimranking="13";} elseif ($target->rank == "Underboss"){$victimranking="14";} elseif ($target->rank == "Boss"){$victimranking="15";} elseif ($target->rank == "Family Boss"){$victimranking="16";} elseif ($target->rank == "Syndicate Boss"){$victimranking="17";} $killerrank = $killerranking+1; $victemrank1 = $victimranking+1; $victemrank = $victemrank1*2; $killergun = $fetch->gunid+1; $victemprotection1 = $target->protectionid+1; $victemprotection = $victemprotection1/2; $killerstat = $killerrank*$killergun; $victemstat = $victemrank*$victemprotection; $bothstat = $victemstat/$killerstat; $killneeded = $bothstat*174; $percentdamage = round($kill_bullets/$killneeded); if($health<=$percentdamage){ echo "<font color=green> <b>$kill_bullets2</b> bullets will be enough bullets to kill <b>$name</b>!</font>"; }elseif ($health>$percentdamage){ echo "<font color=red> <b>$kill_bullets2</b> bullets will not be enough bullets to kill <b>$name</b>!</font>"; } $fingingname = $_POST['name']; } ?> <br><br> <form action="" method="post"> <table border="1" class="sub2" align="center" cellspacing="0" cellpadding="2" bordercolor=black width=50%> <tr> <td align="center" colspan="3" class="header">Bullet Calculator</td> </tr> <tr> <td align="center" colspan="3">Victim's Username: <br> <input type="text" name="name" value="<? echo $fingingname ?>" style="border:1px solid black;"> <br> Estimated Bullets: <br> <input type="text" name="bullets" style="border:1px solid black;"> <br> <input type="submit" name="check" value="Check"></td> </tr> <tr> <td> Bullet calculators calculate the amount of bullets specified for the stats of the killers account and the victims account. </td> </tr> </table> </form> <? }else{ echo "You are not allowed to view this page!";} ?> <br><br> </td> <TD width="150" valign="top"> <?php include("rightmenu.php");?> </TD> </TR> </table> </center> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/180318-why-doesnt-this-work/ Share on other sites More sharing options...
abazoskib Posted November 4, 2009 Share Posted November 4, 2009 Well do you ever set _SESSION["real_name"] at any point before running this script? Quote Link to comment https://forums.phpfreaks.com/topic/180318-why-doesnt-this-work/#findComment-951209 Share on other sites More sharing options...
tidalik Posted November 9, 2009 Share Posted November 9, 2009 Er, you do know you have commented out the echo //echo "I'm not logged in"; header('Location: index.php'); And you need to set the session variable "real_name" before the rest will show.... Quote Link to comment https://forums.phpfreaks.com/topic/180318-why-doesnt-this-work/#findComment-953986 Share on other sites More sharing options...
PravinS Posted November 9, 2009 Share Posted November 9, 2009 First echo is commented and second is blank. Quote Link to comment https://forums.phpfreaks.com/topic/180318-why-doesnt-this-work/#findComment-953991 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.