freelance84 Posted June 24, 2010 Share Posted June 24, 2010 echo <<<_END <form action="nrt-home.php" method="post"> <select name="class_name"> _END; //the current classes into the drop down list for($i = 0 ; $i < $current_number; ++$i) { echo "<option>$current_class_name[$i]</option>"; } echo <<<_END </select> <input type="hidden" name="j_number" value="$j"/> <button class="button-add" type="submit" name="race">Class races</button> <button class="button-edit" type="submit" name="edit">Edit class details</button> <button class="button-delete" type="submit" name="delete">Delete class</button> <br/> </form> _END; The above is a simple form; a drop down menu and three buttons. The form send info back to the same page it is on: nrt-home.php. Depending on which button is pressed a different action is performed when the page reloads: //getting the class name and numb races if passed from form if(isset($_POST['class_name'])) { $class_name = $_POST['class_name']; $get_numb_races = mysql_query("SELECT number_races FROM members_classes WHERE ID = '$u_ID' AND class_name = '$class_name'"); $number_races = mysql_fetch_row($get_numb_races); } //navigating to different page according to form if(isset($_POST['race'])) { header("location:nrt-home-view-racesToDo.php?class_name=$class_name"); } if(isset($_POST['edit'])) { $_SESSION['show/hide']='hide'; header("location:nrt-home-edit-editDelete.php?class_name=$class_name&number_races=$number_races[0]"); } //deleting a class if(isset($_POST['yes_delete']) && isset($_POST['class_name'])) { $class_to_delete = get_post('class_name'); $query_delete = "DELETE FROM members_classes WHERE ID = '$u_ID' AND class_name = '$class_to_delete'"; $result_delete = mysql_query($query_delete); if (!$result_delete) die ("Database access failed: " . mysql_error()); } There is a problem with ie6. With ff and chrome everything is fine. In ie6, it doesn't matter which button the user presses, edit delete or class races, they all go to the edit page. I really don't understand what is going on here as this is just php right? And as i said, everything works fine in ff and chrome. Any ideas? I'm stumped Link to comment https://forums.phpfreaks.com/topic/205731-headers-not-working-in-ie6/ Share on other sites More sharing options...
trq Posted June 24, 2010 Share Posted June 24, 2010 The Location header requires a complete url according to the http spec. It can be problematic without it. Link to comment https://forums.phpfreaks.com/topic/205731-headers-not-working-in-ie6/#findComment-1076548 Share on other sites More sharing options...
phpchamps Posted June 24, 2010 Share Posted June 24, 2010 If you use the button element in an HTML form, different browsers will submit different values. Internet Explorer will submit the text between the <button> and </button> tags, while other browsers will submit the content of the value attribute. Use the input element to create buttons in an HTML form. Link to comment https://forums.phpfreaks.com/topic/205731-headers-not-working-in-ie6/#findComment-1076558 Share on other sites More sharing options...
freelance84 Posted June 24, 2010 Author Share Posted June 24, 2010 Blimey, every day something new. Thanks for the help, i'll see if it works Link to comment https://forums.phpfreaks.com/topic/205731-headers-not-working-in-ie6/#findComment-1076567 Share on other sites More sharing options...
JonnoTheDev Posted June 24, 2010 Share Posted June 24, 2010 Also, make sure you exit after a header redirect header("location:http://xyz.com/nrt-home-view-racesToDo.php?class_name=$class_name"); exit(); Link to comment https://forums.phpfreaks.com/topic/205731-headers-not-working-in-ie6/#findComment-1076575 Share on other sites More sharing options...
freelance84 Posted June 24, 2010 Author Share Posted June 24, 2010 phpchamps, removing the use of the button tag solved it all. It also solved some other odd issues on other pages where I was using the button tag instead of the input. Thanks for the other bits of advice too! Link to comment https://forums.phpfreaks.com/topic/205731-headers-not-working-in-ie6/#findComment-1076644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.