Link to home
Start Free TrialLog in
Avatar of allanch08
allanch08Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Firefox and IE URL difference

Hi experts!

When I perform the same keword search on IE7 and Firefox I get two different URLS for the search results page:

Firefox
http://www.mytestsite.com/search_result.php?search=john+smith&submit.x=0&submit.y=0&submit=submit

IE
http://www.mytestsite.com/search_result.php?search=john&smith

Can someone tell me what this extra bit of text Firefox adds to the URL is and how do I get rid of it to make it look more intelligible? thanks
Avatar of David S.
David S.
Flag of United States of America image

It seems that you're using an <input type="image"> element. One solution might be to remove its name attribute.
Please, show to us the code that contain the forms you use to send the information.
Avatar of allanch08

ASKER

Hello, yes, i'm using an image instead of the usual submit button. I'll try removing the name attribute later on. Any reason why Firefox and IE shoe different URL's? surely if its the web they should show the same URL regardless of browser
SOLUTION
Avatar of v2Media
v2Media
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks that sounds like a logical answer
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
so does this make my url more comprehensible looking as I prefer it without the submit button values?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks. at the moment I'm using GET so that the URL can be bookmarked.  I'm also using php to process the form and the line of code I'm using to check if form is submitted is shown below. I'll have to cehck if this is affected.
if (isset($_POST['submit'])) {
 
xxx
 
}

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks, having an emtpy field is something I overlooked. I'll add that to it and see how it works.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
currently I'm just usingthe code below, it works and looks nicer then the generic submit button. the only annoying thing is the x=0&submit.y=0&submit=submit which do look like co-ordinates of some sorts
<input type="image" src="/images/button.gif" name="submit" alt="submit"/>

Open in new window

"The URL is only a side effect of the issue.  There once was a technology called server-side image maps. It used a form and the <input type="image"> element. When a user clicked on the image, the coordinates were sent to the server which then did some appropriate action. Some browsers still send the coordinates.  Now it's best to avoid using both kinds of image maps due to accessibility issues. There are certain CSS techniques that provide a much more user-friendly equivalent."

So when it comes to this issue is Firefox more standards compliant by displaying this additional information?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks. will read up on that.
I've updated the code to make sure the textfield is not empty. It also occurred to me do I really need to check if the form has been submitted as surely if it hasn't then no search would go through?
//Check if textfield is not empty.
if (!empty($_GET['textfield'])) {
	$textfield = ($_GET['textfield']);
	}
else {
	$textfield = NULL;
	echo 'You forgot to enter a keyword for your search.';
}
// Only allow letters in textfield.
if (preg_match("^/[A-Za-z]+/", $_GET['textfield'])) { 
	$textfield = $_GET['textfield'];
}

Open in new window