kendallkamikaze Posted April 5, 2009 Share Posted April 5, 2009 This code makes you have to refresh in firefox every darn time you click back. Is there anyway to fix this? <?php include "header.php"; $query=mysql_query("select * from player where id='$id'"); $row=mysql_fetch_array($query); //start event if($_POST[event2]){ $eeq=mysql_query("select * from class_event_entered where horseid='$_POST[horseid]' and class='$_POST[cid]'"); $ee=mysql_fetch_array($eeq); if($ee[horseid] == "$_POST[horseid]"){ print "<BR><BR><font size='4pt' face='comic sans ms'>Already entered in this class!<BR><BR> <input type=button value='Back to Class List' onClick='history.go(-1)'></font><BR><BR><BR>";include "footer.php"; exit;} print " <input type=hidden name=cid value=$result[class]>"; mysql_query("insert into class_event_entered ( `class` , `horseid` , `ofshow`, `rundate`) VALUES ('$_POST[cid]','$_POST[horseid]','$_POST[ofshow]','$_POST[rundate]')")or die(mysql_error()); $atype='mod'; if($atype == "diamond" || $atype == "Diamond" || $atype == "mod" || $atype == "Mod"){$upexp="1";}else{$upexp="1";} mysql_query("update horsedata set Exp=Exp+'$upexp',Points=Points+'$upexp' where id='$_POST[horseid]'"); print "<BR><BR><font size='4pt' face='comic sans ms'>Your horse was entered!<BR></font> <input type=button value='←' onClick='history.go(-1)'><BR><BR><BR>";include "footer.php"; exit;}; if($_POST[event1]){ if(empty($_POST[rundate])){print "<BR><BR><font size='4pt' face='comic sans ms'>You forgot to enter a rundate!<BR><BR> <input type=button value='←' onClick='history.go(-1)'><BR><BR><BR></font>";include "footer.php"; exit;} print " <input type=hidden name=hid value='$_POST[hid]'> <input type=hidden name=rundate value='$_POST[rundate]'> <input type=hidden name=event2 value=event2> "; $sq=mysql_query("select * from class_event where rundate like '$_POST[rundate]%' and createdby like '$_POST[createdby]%' and ofshow like '$_POST[ofshow]%' order by class asc")or die(mysql_error()); $results=mysql_num_rows($sq); if($results == "0"){ print "<BR><BR><font size='4pt' face='comic sans ms'>No results.<BR><BR> <input type=button value='←' onClick='history.go(-1)'><BR><BR><BR></font>";include "footer.php"; exit;} print "<input type=button value='←' onClick='history.go(-1)'> <br><br> <b>Horse Participating:</b> #$_POST[hid]<br> <b>Results.</b> (searching rundate <i><u>$_POST[rundate]</u></i>)<br>"; print "<divv style=width:500;height:500;overflow:auto><table style='border:1px;'> <tr><td>"; for($i=0;$i<$results;$i++){ $result=mysql_fetch_array($sq); $skq=mysql_query("select * from class_event_entered where class='$result[class]' and horseid='$_POST[hid]'")or die(mysql_error()); $horses=mysql_num_rows($skq); //if($horses == "1"){$disabled="disabled";} print "<form method=post action=shows.php> <input type=hidden name=event2 value=event2> <input type=hidden name=rundate value=$result[rundate]> <input type=hidden name=ofshow value=$result[ofshow]> <input type=hidden name=horseid value=$_POST[hid]> <input type=hidden name=cid value='$result[class]'> <input type=submit value='Enter' $disabled> Class #$result[class]. Created by: $result[createdby]. Of Show #$result[ofshow]</form>"; } print "</form></div></td></tr></table><br><br>";include "footer.php"; exit; } //end event script //start exp show script if($_POST[enterclass]){ if(empty($_POST[level])){print "<BR><BR><font size='4pt' face='comic sans ms'>You forgot to pick a class! <BR><BR><input type=button value='Back to Class List' onClick='history.go(-1)'><BR><BR><BR></font>";include "footer.php"; exit;} $llq=mysql_query("select * from class_entered where horseid='$_POST[hid]' and classid='$_POST[level]'"); $levell=mysql_fetch_array($llq); if($levell[horseid] == "$_POST[hid]"){ print "<BR><BR><div width='400px'><font face='comic sans ms' size='4pt'>Already entered in this class,<BR> refresh the page to see what classes your horse has entered.<BR><BR> <input type=button value='Back to Class List' onClick='history.go(-1)'></font><br><BR><BR>";include "footer.php";exit;} mysql_query("insert into class_entered ( `classid` , `horseid` , `level`) VALUES ('$_POST[level]','$_POST[hid]','$_POST[enterclass2]')")or die(mysql_error()); $atype='mod'; if($atype == "diamond" || $atype == "Diamond" || $atype == "mod" || $atype == "Mod"){$upexp="2";}else{$upexp="1";} mysql_query("update horsedata set Exp=Exp+'$upexp' where id='$_POST[hid]'"); print "<BR><font size='3pt'><center>Participant horse <b>#$_POST[hid]</b> was entered in to <b>Class id #$_POST[level]</b> in <b>Level $_POST[enterclass2]</b><br><BR> <input type=button value='Back to Class List' onClick='history.go(-1)'></font><BR><BR><BR> ";include "footer.php";exit;} if($_POST[viewclasses]){ //exp shows $lvl="$_POST[level]"; $hid="$_POST[hid]"; $lq=mysql_query("select * from class_level where level='$lvl'"); $lvls=mysql_num_rows($lq); print "<form method=post action=shows.php> <b>Show Type:</b> Experience<br> <b>Horse Participating:</b> #$hid <br> <b>Level:</b> #$lvl <br> <br> <b>Classes in Level: </b>(15 total) <input type=button value='←' onClick='history.go(-1)'> <input type=submit value='→'><br> <sup>Refresh the page to see what classes your horse has entered.</sup><br> "; //if(empty($levls)){print "<BR><BR><font size='4pt' face='comic sans ms'>No classes yet.</font><BR><BR><BR> ";include "footer.php"; exit;} for($i=0;$i<$lvls;$i++){ $level=mysql_fetch_array($lq); $llq=mysql_query("select * from class_entered where horseid='$hid' and classid='$level[id]'"); $levell=mysql_fetch_array($llq); if($hid == $levell[horseid]){ print " <input type=hidden name=hid value='$hid'> <input type=hidden name=enterclass value='$level[id]'> <input type=hidden name=enterclass2 value='$lvl'>"; print "<s>Class -id#$level[id]</s><br>"; }else{ print " <input type=hidden name=hid value='$hid'> <input type=hidden name=enterclass value='$level[id]'> <input type=hidden name=enterclass2 value='$lvl'>"; print "<input type=radio value='$level[id]' name=level>Class -id#$level[id]<br>"; }} include "footer.php";exit;} if($_POST[viewlevels]){ //exp shows $hid="$_POST[hid]"; $hq=mysql_query("select * from horsedata where id='$_POST[hid]'"); $horse=mysql_fetch_array($hq); $exp=$horse[Exp]; print "<form method=post action=shows.php> <input type=hidden name=viewclasses value=viewclasses> <input type=hidden name=hid value=$_POST[hid]> <input type=hidden name=points value=$_POST[points]> <b>Show Type:</b> Experience<br> <b>Horse Participating:</b> #$hid<br> <b>Current Experience Points:</b> $exp<br><br> <b>Your Horses Level:</b><br> <select name=level> "; if($exp == "0" || $exp <= "3704"){print "<option value=1>1 (0-3,704 points)</option>";} if($exp > "3704" && $exp < "6000"){print "<option value=2>2 (3,705-5,999 points)</option>";} if($exp > "5999" && $exp < "9000"){print "<option value=3>3 (6,000-8,999 points)</option>";} if($exp > "8999" && $exp < "11705"){print "<option value=4>4 (9,000-11,704 points)</option>";} if($exp > "11704" && $exp < "14000"){print "<option value=5>5 (11,705-13,999 points)</option>";} if($exp > "13999" && $exp < "16705"){print "<option value=6>6 (14,000-16,704 points)</option>";} if($exp > "16704" && $exp < "19000"){print "<option value=7>7 (16,705-18,999 points)</option>";} if($exp > "18999" && $exp < "22000"){print "<option value=8>8 (19,000-21,999 points)</option>";} if($exp > "21999" && $exp < "23705"){print "<option value=9>9 (22,000-23,704 points)</option>";} if($exp > "23704" && $exp < "26000"){print "<option value=10>10 (23,705-25,999 points)</option>";} if($exp > "25999" && $exp < "28705"){print "<option value=11>11 (26,000-28,704 points)</option>";} if($exp > "28704" && $exp < "35001"){print "<option value=12>12 (28,705-35,000 points)</option>";} if($exp > "35000" && $exp < "40705"){print "<option value=13>13 (35,001-40,704 points)</option>";} if($exp > "40704" && $exp < "61000"){print "<option value=14>14 (40,705-60,999 points)</option>";} if($exp > "60999" && $exp < "78000"){print "<option value=15>15 (61,000-77,999 points)</option>";} if($exp > "779999" && $exp < "87705"){print "<option value=16>16 (78,000-87,704 points)</option>";} if($exp > "87704" && $exp < "100001"){print "<option value=17>17 (88,705-100,000 points)</option>";} if($exp > "100000" && $exp < "220000"){print "<option value=18>18 (100,001-219,999 points)</option>";} if($exp > "219999" && $exp < "630001"){print "<option value=19>19 (220,000-630,000 points)</option>";} if($exp > "630000" && $exp < "999999999999999999"){print "<option value=20>20 (630,001-999,999,999 points)</option>";} if($bob){ print " <option value=1>1 (0-3,704 points)</option> <option value=2>2 (3,705-5,999 points)</option> <option value=3>3 (6,000-8,999 points)</option> <option value=4>4 (9,000-11,704 points)</option> <option value=5>5 (11,705-13,999 points)</option> <option value=6>6 (14,000-16,704 points)</option> <option value=7>7 (16,705-18,999 points)</option> <option value=8>8 (19,000-21,999 points)</option> <option value=9>9 (22,000-23,704 points)</option> <option value=10>10 (23,705-25,999 points)</option> <option value=11>11 (26,000-28,704 points)</option> <option value=12>12 (28,705-35,000 points)</option> <option value=13>13 (35,001-40,704 points)</option> <option value=14>14 (40,705-60,999 points)</option> <option value=15>15 (61,000-77,999 points)</option> <option value=16>16 (78,000-87,704 points)</option> <option value=17>17 (88,705-100,000 points)</option> <option value=18>18 (100,001-219,999 points)</option> <option value=19>19 (220,000-630,000 points)</option> <option value=20>20 (630,001-999,999,999 points)</option>";} print " </select><input type=submit value='Select Level'> </form>"; include "footer.php"; exit;} print "<font color='#46522a'><img src='items/show2.jpg'><BR> <DIV style='width:550px;'><font size='2pt' face='comic sans ms'><center>There are <u>3 types of shows</u>: <i>Experience, Event, and Barn</i> shows. Experience shows are made by the game. Each level contains 15 classes made by the game each day at 12pm PST. Horses that are entered into experience shows gain one experience point per entry or two if the horse's owner is upgraded. Horses will only receive experience points (when the classes run) if they place 1-6th in a class. Event shows are made by upgraded players. Upgraded players can create 3 shows a day (each show contains 5 classes) and choose their run date. Horses gain one point per entry and one experience point per entry if the user is upgraded. Only 6 horses (non-upgraded member's and upgraded member's horses) will place in each class and receive points. Barn shows will remain judged by hand by the game's community.</div><br><BR>"; //exp show horses $hq=mysql_query("select * from horsedata where Owner='$id' AND creature='No' AND DOB > 2 AND DOB < 24 ORDER BY id desc"); $horses=mysql_num_rows($hq); if($horses == "0"){print "<BR><BR><font size='4pt' face='comic sans ms'><center>You need some horses before you can compete in a show.</font><BR><BR>";include "footer.php"; exit;} print "<DIV style='width:400px;text-align:justify;'> <form method=post action=shows.php> <input type=hidden name=viewlevels value=viewlevels> <font size='4pt'><b>Show Type:</b> Experience<br></font> <font size='3pt'><sup>Experience shows are for solely for earning experience points. Each horse has a level based on its experience points.</sup><br></font></div> Select a Horse <br> <select name=hid> "; for($i=0;$i<$horses;$i++){ $horse=mysql_fetch_array($hq); print "<option value=$horse[id]>(#$horse[id]) $horse[Name]</option>"; } print "</select><BR> <input value='Select this Horse' type=submit></form><BR><BR><BR> "; //event show horses $hq=mysql_query("select * from horsedata where Owner='$id' AND creature='No'AND DOB > 2 AND DOB < 24 ORDER BY id desc"); $horses=mysql_num_rows($hq); if($horses == "0"){print "<BR><BR><font size='4pt' face='comic sans ms'><center>You need some horses before you can compete in a show.</font><BR><BR><BR>";include "footer.php"; exit;} print "<BR> <DIV style='width:400px;text-align:justify;'> <form method=post action=shows.php> <input type=hidden name=event1 value=event1> <font size='4pt'><b>Show Type:</b> Event (<a href=create_event.php>click here to create an event show</a>)</font><BR> <font size='3pt'> <sup> Event shows are made by upgraded players. Upgraded players get 2 show points per entry and non-upgraded members will get 1 point for entering, but horses are able to place in 1-6th place.<BR></font> </sup></div> Select a Horse <br> <select name=hid> "; for($i=0;$i<$horses;$i++){ $horse=mysql_fetch_array($hq); print "<option value=$horse[id]>(#$horse[id]) $horse[Name]</option>"; } print "</select>"; print "<br>Type a rundate (i.e: 05-05-2009). <sup>Required</sup><br><input type='text' name='rundate'> <br>Created By. (i.e: 1445). <sup>Optional</sup><br><input type='text' name='createdby'> <br>ShowID# (i.e: 24593). <sup>Optional</sup><br><input type='text' name='ofshow'> <br> <input value='Select and Search' type=submit></form></div></font><BR><BR><BR> "; include "footer.php"; ?> Link to comment https://forums.phpfreaks.com/topic/152669-php-issue-with-firefox-makes-you-refresh/ Share on other sites More sharing options...
kendallkamikaze Posted April 5, 2009 Author Share Posted April 5, 2009 so apparently its not just firefox either, its Internet Explorer, and Google Chrome. It works fine in Opera. Link to comment https://forums.phpfreaks.com/topic/152669-php-issue-with-firefox-makes-you-refresh/#findComment-801766 Share on other sites More sharing options...
mrMarcus Posted April 5, 2009 Share Posted April 5, 2009 It's the $_POST data. requires the information to be submitted via a form submission, so clicking the back button will require the user to reload the page to resubmit the information .. should be the same on most/all browsers that i know of, definitely not just Firefox. if you expect your users will be hitting the back button often, consider the $_GET method. Link to comment https://forums.phpfreaks.com/topic/152669-php-issue-with-firefox-makes-you-refresh/#findComment-801880 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.