Jump to content

image submit


anthony-needs-you

Recommended Posts

Hi i have some sort by buttons:

 

<form method="POST" action="<?php echo($_SERVER['PHP_SELF']); ?>">
<input name="resort" value="resort" type="image" onMouseOver="this.src='elements/images/layout/r-resort-active.gif'" onMouseOut="this.src='elements/images/layout/r-resort-inactive.gif'" src="elements/images/layout/r-resort-inactive.gif" class="button" border"0">
</form>

 

 

This is the code it posts to:

 

if(isset($_POST['authorDate'])){

       $authorDate=$_POST['authorDate'];

	$type="authorDate";

}elseif(isset($_POST['hotel'])){

       $hotel=$_POST['hotel'];

	$type="hotel";

	}elseif(isset($_POST['destination'])){

       $destination=$_POST['destination'];

	$type="destination";

}elseif(isset($_POST['resort'])){

       $resort=$_POST['resort'];

	$type="resort";

}elseif(!isset($_POST[''])){


	$type="hotel";
}

 

and this is the part of the code it sorts via $type:

 

$query = "SELECT id, destination, author, resort, hotel, authorDate, description, stars FROM reviews ORDER BY $type LIMIT $startrow, 10";

 

It works in firefox but not in IE does anyone know why?

Link to comment
https://forums.phpfreaks.com/topic/140092-image-submit/
Share on other sites

Read this for how to use an image as a submit button so that it works in all browsers - http://us.php.net/manual/en/faq.html...tml.form-image

 

The W3.org definition for an image button only requires that the x,y coordinate values be sent when the button is clicked. The browsers that send the value="..." parameter are actually providing a custom browser specific action that is not defined in the w3.org standard.

Link to comment
https://forums.phpfreaks.com/topic/140092-image-submit/#findComment-734781
Share on other sites

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.