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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.