cry of war Posted July 22, 2007 Share Posted July 22, 2007 When I try to load this page I just get a white screen so there is some wrong scripting in there some where i just cant find it can some one help out. And does anyone know of a good php debugger? <?php if (!isset($_POST['add'])) { $info = $_POST['info']; $id = $_POST['id']; $find = array('Mercenaries', 'Jaffa Army', 'Super Soldiers', 'Drones', 'Clones', 'bot', 'Units', 'Human Form troop7', 'Soldier', 'NID Agent', 'Army', ' ', ','); $replace = array('troop1','troop2','troop3','troop4','troop5','troop6','troop7','troop8','troop9','troop10','troop11', ' ', ''); $info = str_replace($find, $replace, $info); $info = explode(" ", $info); $armynouu = array(is_int($info[79]), is_int($info[80]), is_int($info[81]), is_int($info[83]), is_int($info[84]), is_int($info[87]), is_int($info[88]), is_int($info[89]), is_int($info[109]), is_int($info[115])); $armynouu2 = array_sum($armynouu); if ($info[82]==$replace[6]) { $race = '~'; } else if ($info[82]==$replace[1]) { $race = '~~'; } else if ($info[82]==$replace[3]) { $race = '~~~'; } else if ($info[82]==$replace[8]) { $race = '~~~~'; } else if ($info[82]==$replace[10]) { $race = '****'; } else { $race = '????'; } if ($info[118] => 2500) { $active = 'ACTIVE'; } else { $active = ''; } if ($active=='ACTIVE') { if ($urlnum == "") { $urlnum = 0; $finish = 0; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info2[16]($info2[121])</a>$race<br />"; } else { $urlnum = $urlnum++; $finish = $finish++; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info2[16]($info2[121])</a>$race<br />"; } } else { if ($urlnum == "") { $urlnum = 0; $finish = 0; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info2[16]($info2[121])</a>$race<br />"; } else { $urlnum = $urlnum++; $finish = $finish++; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$info2[16]($armynouu2 ~ $info2[121])</a>$race<br />"; } } ?> <html> <head> <title>UMMM???</title> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> PLEASE CLICK INSIDE OF THE SGW SPY LOG AREA AND PRESS CTRL+A THEN CTRL+C THEN CLICK IN THE TEXT AREA BELOW WHERE IT SAYS "INSERT HERE". <textarea rows="20" cols="20" name="info">INSERT HERE</textarea><br /> ENTER ID: <INPUT TYPE="TEXT" name="id" value="INPUT ID HERE" /><br /> <input type="submit" value="add" name="add"/><input type="submit" value="submit" name="submit" /> </form> <?php } elseif (!isset($_POST['submit'])) { ?> <html> <head> <title>Personal INFO</title> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> PLEASE CLICK INSIDE OF THE SGW SPY LOG AREA AND PRESS CTRL+A THEN CTRL+C THEN CLICK IN THE TEXT AREA BELOW WHERE IT SAYS "INSERT HERE". <textarea rows="20" cols="20" name= "info">INSERT HERE</textarea><br /> ENTER ID: <INPUT TYPE="TEXT" name="id" value="INPUT ID HERE" /><br /> <input type="submit" value="add" name="add"/><input type="submit" value="submit" name="submit" /> </form> <?php } else { for($urlnum = 0; $urlnum <= 200; $urlnum++) { echo "$url[$urlnum]"; echo "<TD><FORM name=spyr action=spy2.php method=post><INPUT type=hidden value=recon name=mission_type><INPUT type=hidden name=confirm value=\"706965\"><INPUT type=hidden name=numspies value=\"99999999999999999\"><input type=hidden value=\"85540\" name=defender_id><input type=image src='pic/eye3.jpg' alt='recon with all agents' title='recon with all agents' name='spyrbut' onclick=\"document.spyr.spyrbut.disabled=true; document.spyr.submit();\"></FORM><TD><FORM name=attackR action=attack2.php method=post><INPUT type=hidden name=confirm value=\"706965\"><INPUT type=hidden name=attacks value=\"1\"><input type=hidden value=\"$id\" name=defender_id4><input type=image src='pic/att_pop.jpg' alt='full turn raid' title='full turn raid' name=\"attackbutR0\" onclick=\"document.attackR0.attackbutR0.disabled=true; document.attackR0.submit();\"></FORM>"; } } ?> <?php echo "</body>": echo "<html>": ?> Link to comment https://forums.phpfreaks.com/topic/61188-can-any-one-tell-whats-wrong-in-this/ Share on other sites More sharing options...
Drumminxx Posted July 22, 2007 Share Posted July 22, 2007 if ($info[118] => 2500) { $active = 'ACTIVE'; } else { $active = ''; } change the operator to >= if ($info[118] >= 2500) { $active = 'ACTIVE'; } else { $active = ''; } Link to comment https://forums.phpfreaks.com/topic/61188-can-any-one-tell-whats-wrong-in-this/#findComment-304499 Share on other sites More sharing options...
cry of war Posted July 22, 2007 Author Share Posted July 22, 2007 there is still something wrong with it. Link to comment https://forums.phpfreaks.com/topic/61188-can-any-one-tell-whats-wrong-in-this/#findComment-304676 Share on other sites More sharing options...
lewis987 Posted July 22, 2007 Share Posted July 22, 2007 the error is this: was echo "</body>": echo "<html>": SHOULD BE: echo "</body>"; echo "<html>"; it works on my server Link to comment https://forums.phpfreaks.com/topic/61188-can-any-one-tell-whats-wrong-in-this/#findComment-304684 Share on other sites More sharing options...
cry of war Posted July 22, 2007 Author Share Posted July 22, 2007 ok the buttons do everything i want them to do now and stuff like that now the only problem i have left is that the add button when pressed is not making a new id for the item like it should be or something else isnt working right when you press add it should be like $url1="such and such" press again $url2="such and such" press again $url3="such and such" then when the submit button is pressed it doesnt show any of the "add" $url values like it should (should show a list of all of the $url values you have compiled) all it shows is the last echo echo "<TD>\n<FORM name=spyr action=spy2.php method=post>\n<INPUT type=hidden value=recon name=mission_type>\n<INPUT type=hidden name=confirm value=\"706965\">\n<INPUT type=hidden name=numspies value=\"99999999999999999\">\n<input type=hidden value=\"85540\" name=defender_id>\n<input type=image src='pic/eye3.jpg' alt='recon with all agents' title='recon with all agents' name='spyrbut' onclick=\"document.spyr.spyrbut.disabled=true; document.spyr.submit();\">\n</FORM>\n<TD>\n<FORM name=attackR action=attack2.php method=post>\n<INPUT type=hidden name=confirm value=\"706965\">\n<INPUT type=hidden name=attacks value=\"1\">\n<input type=hidden value=\"$id\" name=defender_id4>\n<input type=image src='pic/att_pop.jpg' alt='full turn raid' title='full turn raid' name=\"attackbutR0\" onclick=\"document.attackR0.attackbutR0.disabled=true; document.attackR0.submit();\">\n</FORM>"; command and not the echo "$url[$urlnum]\n"; line here is the new updated php file I made that is having some issues <?php if (isset($_POST['add'])) { $info = $_POST['info']; $id = $_POST['id']; $find = array('Mercenaries', 'Jaffa Army', 'Super Soldiers', 'Drones', 'Clones', 'bot', 'Units', 'Human Form troop7', 'Soldier', 'NID Agent', 'Army', ' ', ','); $replace = array('troop1','troop2','troop3','troop4','troop5','troop6','troop7','troop8','troop9','troop10','troop11', ' ', ''); $info = str_replace($find, $replace, $info); $info = explode(" ", $info); $armynouu = array(is_int($info[79]), is_int($info[80]), is_int($info[81]), is_int($info[83]), is_int($info[84]), is_int($info[87]), is_int($info[88]), is_int($info[89]), is_int($info[109]), is_int($info[115])); $armynouu2 = array_sum($armynouu); if ($info[82]==$replace[6]) { $race = '~'; } else if ($info[82] == "$replace[1]") { $race = '~~'; } else if ($info[82] == "$replace[3]") { $race = '~~~'; } else if ($info[82] == "$replace[8]") { $race = '~~~~'; } else if ($info[82] == "$replace[10]") { $race = '****'; } else { $race = '????'; } if (2500 >= $info[118]) { $active = 'ACTIVE'; } else { $active = ''; } if ($active=='ACTIVE') { if ($urlnum == "") { $urlnum = 0; $finish = 0; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info2[16]($info2[121])</a>$race<br />"; } else { $urlnum = $urlnum++; $finish = $finish++; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info2[16]($info2[121])</a>$race<br />"; } } else { if ($urlnum == "") { $urlnum = 0; $finish = 0; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info2[16]($info2[121])</a>$race<br />"; } else { $urlnum = $urlnum++; $finish = $finish++; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$info2[16]($armynouu2 ~ $info2[121])</a>$race<br />"; } } ?> <html> <head> <title>title2</title> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> PLEASE CLICK INSIDE OF THE SGW SPY LOG AREA AND PRESS CTRL+A THEN CTRL+C THEN CLICK IN THE TEXT AREA BELOW WHERE IT SAYS "INSERT HERE". <textarea rows="20" cols="20" name= "info">INSERT HERE</textarea><br /> ENTER ID: <INPUT TYPE="TEXT" name="id" value="INPUT ID HERE"><br /> <input type="submit" value="add" name="add"><input type="submit" value="submit" name="submit"> </form> <?php } elseif (!isset($_POST['submit'])) { $info = $_POST['info']; $id = $_POST['id']; $find = array('Mercenaries', 'Jaffa Army', 'Super Soldiers', 'Drones', 'Clones', 'bot', 'Units', 'Human Form troop7', 'Soldier', 'NID Agent', 'Army', ' ', ','); $replace = array('troop1','troop2','troop3','troop4','troop5','troop6','troop7','troop8','troop9','troop10','troop11', ' ', ''); $info = str_replace($find, $replace, $info); $info = explode(" ", $info); $armynouu = array(is_int($info[79]), is_int($info[80]), is_int($info[81]), is_int($info[83]), is_int($info[84]), is_int($info[87]), is_int($info[88]), is_int($info[89]), is_int($info[109]), is_int($info[115])); $armynouu2 = array_sum($armynouu); if ($info[82]==$replace[6]) { $race = '~'; } else if ($info[82] == "$replace[1]") { $race = '~~'; } else if ($info[82] == "$replace[3]") { $race = '~~~'; } else if ($info[82] == "$replace[8]") { $race = '~~~~'; } else if ($info[82] == "$replace[10]") { $race = '****'; } else { $race = '????'; } if (2500 >= $info[118]) { $active = 'ACTIVE'; } else { $active = ''; } if ($active=='ACTIVE') { if ($urlnum == "") { $urlnum = 0; $finish = 0; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info2[16]($info2[121])</a>$race<br />"; } else { $urlnum = $urlnum++; $finish = $finish++; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info2[16]($info2[121])</a>$race<br />"; } } else { if ($urlnum == "") { $urlnum = 0; $finish = 0; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info2[16]($info2[121])</a>$race<br />"; } else { $urlnum = $urlnum++; $finish = $finish++; $url[$urlnum]="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$info2[16]($armynouu2 ~ $info2[121])</a>$race<br />"; } } ?> <html> <head> <title>title 1</title> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> PLEASE CLICK INSIDE OF THE SGW SPY LOG AREA AND PRESS CTRL+A THEN CTRL+C THEN CLICK IN THE TEXT AREA BELOW WHERE IT SAYS "INSERT HERE". <textarea rows="20" cols="20" name="info">INSERT HERE</textarea><br /> ENTER ID: <INPUT TYPE="TEXT" name="id" value="INPUT ID HERE"><br /> <input type="submit" value="add" name="add"><input type="submit" value="submit" name="submit"> </form> <?php } elseif (isset($_POST['submit'])) { $finish = $urlnum; for($urlnum = 0; $urlnum <= $finish; $urlnum++) { echo "$url[$urlnum]\n"; echo "<TD>\n<FORM name=spyr action=spy2.php method=post>\n<INPUT type=hidden value=recon name=mission_type>\n<INPUT type=hidden name=confirm value=\"706965\">\n<INPUT type=hidden name=numspies value=\"99999999999999999\">\n<input type=hidden value=\"85540\" name=defender_id>\n<input type=image src='pic/eye3.jpg' alt='recon with all agents' title='recon with all agents' name='spyrbut' onclick=\"document.spyr.spyrbut.disabled=true; document.spyr.submit();\">\n</FORM>\n<TD>\n<FORM name=attackR action=attack2.php method=post>\n<INPUT type=hidden name=confirm value=\"706965\">\n<INPUT type=hidden name=attacks value=\"1\">\n<input type=hidden value=\"$id\" name=defender_id4>\n<input type=image src='pic/att_pop.jpg' alt='full turn raid' title='full turn raid' name=\"attackbutR0\" onclick=\"document.attackR0.attackbutR0.disabled=true; document.attackR0.submit();\">\n</FORM>"; } } else { ?> <html> <head> <title>title3</title> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> PLEASE CLICK INSIDE OF THE SGW SPY LOG AREA AND PRESS CTRL+A THEN CTRL+C THEN CLICK IN THE TEXT AREA BELOW WHERE IT SAYS "INSERT HERE". <textarea rows="20" cols="20" name="info">INSERT HERE</textarea><br /> ENTER ID: <INPUT TYPE="TEXT" name="id" value="INPUT ID HERE"><br /> <input type="submit" value="submit" name="submit"><input type="submit" value="add" name="add"> </form> <?php } ?> <?php echo "</body>"; echo "<html>"; ?> Link to comment https://forums.phpfreaks.com/topic/61188-can-any-one-tell-whats-wrong-in-this/#findComment-304727 Share on other sites More sharing options...
bilabong007 Posted July 22, 2007 Share Posted July 22, 2007 Hi, Is the last echo opening another html tag or have you missed the / ? I thought it would be </html> to close it. Im new to this so dont laugh if i being stupid. Hope this helps Graeme Link to comment https://forums.phpfreaks.com/topic/61188-can-any-one-tell-whats-wrong-in-this/#findComment-304779 Share on other sites More sharing options...
cry of war Posted July 22, 2007 Author Share Posted July 22, 2007 yeah your right the last echo <html>; does need to be </html>; but that wouldnt be causing this prob. Link to comment https://forums.phpfreaks.com/topic/61188-can-any-one-tell-whats-wrong-in-this/#findComment-304801 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.