Jump to content

headers not working in ie6


freelance84

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.