Connecting Tech Pros Worldwide Forums | Help | Site Map

-> Image submit buttons OK in Firefox, not in IExplorer. Why? <-

Steve JORDI
Guest
 
Posts: n/a
#1: Dec 7 '06
Just a question using images as submit buttons and PHP4.4.4.
It seems that my code correctly works in FireFox but not in IExplorer.

For example, I have a FORM with 2 buttons called "search" and "save".
In a second file, the one mentioned in the "action" parameter,
I test which button has been clicked in order to decide which action
to take.

IExplorer doesn't get anything, FireFox correctly works.

Example:

file main.php
=============
<form id="myform" name="myform" method="post" action="process.php">
....
<INPUT name="search" type="image" value="search"
src="images/search.gif" alt="search" />
<INPUT name="save" type="image" value="save"
src="images/save.gif" alt="save" />
</form>

file process.php
================
echo "***".$_POST."<BR>" ; // Always returns an empty Array
if( isset($_POST['search'])) {
header("Location: ./search.php") ;
}
else
if( isset($_POST['save'])) {
header( "Location: ./save.php" ) ;
}
else {
echo "Houston, we've got a problem<br />" ;
}


Firefox correctly sees the variables "search" and "save".
Internet explorer always "contacts Houston".

I have tried to name my two INPUT to "submit"

<INPUT name="submit" type="image" value="search"
src="images/search.gif" alt="search" />
<INPUT name="submit" type="image" value="save"
src="images/save.gif" alt="save" />

and then check the value of the submit, using

if( $_POST['submit'] == 'search' )...

Doesn't work in IExplorer.


Then I checked to see whether I have the search_x or save_x variable
that are supposedly automatically created, but they don't exist in
neither browser.
That's why my echo $_POST returns nothing.

What's wrong here?
Any help would be greatly appreciated.

Thanks in advance.




Sincerely,
Steve JORDI

(Remove the K_I_L_LSPAM from my email address)
------------------------------------------------
1197 Prangins Email: stevejordiK_I_L_LSPAM@hotmail.com
Switzerland WWW: www.sjordi.com
------------------------------------------------
Volcanoes at www.sjordi.com/volcanoes
MovieDB at www.sjmoviedb.com
------------------------------------------------

Jerry Stuckle
Guest
 
Posts: n/a
#2: Dec 7 '06

re: -> Image submit buttons OK in Firefox, not in IExplorer. Why? <-


Steve JORDI wrote:
Quote:
Just a question using images as submit buttons and PHP4.4.4.
It seems that my code correctly works in FireFox but not in IExplorer.
>
For example, I have a FORM with 2 buttons called "search" and "save".
In a second file, the one mentioned in the "action" parameter,
I test which button has been clicked in order to decide which action
to take.
>
IExplorer doesn't get anything, FireFox correctly works.
>
Example:
>
file main.php
=============
<form id="myform" name="myform" method="post" action="process.php">
...
<INPUT name="search" type="image" value="search"
src="images/search.gif" alt="search" />
<INPUT name="save" type="image" value="save"
src="images/save.gif" alt="save" />
</form>
>
file process.php
================
echo "***".$_POST."<BR>" ; // Always returns an empty Array
if( isset($_POST['search'])) {
header("Location: ./search.php") ;
}
else
if( isset($_POST['save'])) {
header( "Location: ./save.php" ) ;
}
else {
echo "Houston, we've got a problem<br />" ;
}
>
>
Firefox correctly sees the variables "search" and "save".
Internet explorer always "contacts Houston".
>
I have tried to name my two INPUT to "submit"
>
<INPUT name="submit" type="image" value="search"
src="images/search.gif" alt="search" />
<INPUT name="submit" type="image" value="save"
src="images/save.gif" alt="save" />
>
and then check the value of the submit, using
>
if( $_POST['submit'] == 'search' )...
>
Doesn't work in IExplorer.
>
>
Then I checked to see whether I have the search_x or save_x variable
that are supposedly automatically created, but they don't exist in
neither browser.
That's why my echo $_POST returns nothing.
>
What's wrong here?
Any help would be greatly appreciated.
>
Thanks in advance.
>
>
>
>
Sincerely,
Steve JORDI
>
(Remove the K_I_L_LSPAM from my email address)
------------------------------------------------
1197 Prangins Email: stevejordiK_I_L_LSPAM@hotmail.com
Switzerland WWW: www.sjordi.com
------------------------------------------------
Volcanoes at www.sjordi.com/volcanoes
MovieDB at www.sjmoviedb.com
------------------------------------------------
Nothing's wrong with your code. IE's broke. For image buttons it only
sends the x and y coordinates of the selection, not the value. IIRC,
the correct values are $_POST['submit.x'] and $_POST['submit.y'] (which
Firefox also correctly sends).


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Steve JORDI
Guest
 
Posts: n/a
#3: Dec 7 '06

re: -> Image submit buttons OK in Firefox, not in IExplorer. Why? <-


Hi Jerry,

Don't know why, but I had a hunch that you would be the one answering
:-)

Quote:
>Nothing's wrong with your code. IE's broke.
Argh! Stupid IE!
Quote:
>For image buttons it only sends the x and y coordinates of the
>selection, not the value.
Yes I know but I could have been checking their existence to
determine which button has been pressed.
If $search.x existed, I would know that the user would have clicked
the search button.

Oh well, I'll force the user to use FireFox. After all they pretend
to be professional, so they have no excuse to use a "toy" like IE.

Thanks

Sincerely,
Steve JORDI

(Remove the K_I_L_LSPAM from my email address)
------------------------------------------------
1197 Prangins Email: stevejordiK_I_L_LSPAM@hotmail.com
Switzerland WWW: www.sjordi.com
------------------------------------------------
Volcanoes at www.sjordi.com/volcanoes
MovieDB at www.sjmoviedb.com
------------------------------------------------
ED
Guest
 
Posts: n/a
#4: Dec 7 '06

re: -> Image submit buttons OK in Firefox, not in IExplorer. Why? <-



"Jerry Stuckle" <jstucklex@attglobal.netwrote in message
news:75qdnbctefb-p-XYnZ2dnUVZ_t-mnZ2d@comcast.com...
Quote:
Steve JORDI wrote:
Quote:
>Just a question using images as submit buttons and PHP4.4.4.
>It seems that my code correctly works in FireFox but not in IExplorer.
>>
>For example, I have a FORM with 2 buttons called "search" and "save".
>In a second file, the one mentioned in the "action" parameter,
>I test which button has been clicked in order to decide which action
>to take.
>>
>IExplorer doesn't get anything, FireFox correctly works.
>>
>Example:
>>
>file main.php
>=============
><form id="myform" name="myform" method="post" action="process.php">
>...
><INPUT name="search" type="image" value="search"
>src="images/search.gif" alt="search" />
><INPUT name="save" type="image" value="save"
>src="images/save.gif" alt="save" />
></form>
>>
>file process.php
>================
>echo "***".$_POST."<BR>" ; // Always returns an empty Array
>if( isset($_POST['search'])) {
>header("Location: ./search.php") ;
>}
>else if( isset($_POST['save'])) {
>header( "Location: ./save.php" ) ;
>}
>else {
>echo "Houston, we've got a problem<br />" ;
>}
>>
>>
>Firefox correctly sees the variables "search" and "save". Internet
>explorer always "contacts Houston".
>>
>I have tried to name my two INPUT to "submit"
>>
><INPUT name="submit" type="image" value="search"
>src="images/search.gif" alt="search" />
><INPUT name="submit" type="image" value="save"
>src="images/save.gif" alt="save" />
>>
>and then check the value of the submit, using
>>
>if( $_POST['submit'] == 'search' )...
>>
>Doesn't work in IExplorer.
>>
>>
>Then I checked to see whether I have the search_x or save_x variable
>that are supposedly automatically created, but they don't exist in
>neither browser.
>That's why my echo $_POST returns nothing.
>>
>What's wrong here?
>Any help would be greatly appreciated.
>>
>Thanks in advance.
>>
>>
>>
>>
>Sincerely,
>Steve JORDI
>>
>(Remove the K_I_L_LSPAM from my email address)
>------------------------------------------------
>1197 Prangins Email: stevejordiK_I_L_LSPAM@hotmail.com
>Switzerland WWW: www.sjordi.com
>------------------------------------------------
>Volcanoes at www.sjordi.com/volcanoes
>MovieDB at www.sjmoviedb.com
>------------------------------------------------
>
Nothing's wrong with your code. IE's broke. For image buttons it only
sends the x and y coordinates of the selection, not the value. IIRC, the
correct values are $_POST['submit.x'] and $_POST['submit.y'] (which
Firefox also correctly sends).
>
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Actually, I think the correct vars are $_POST['submit_x'] and
$_POST['submit_y']
(with underscore).

cheers,
ED


Geoff Berrow
Guest
 
Posts: n/a
#5: Dec 7 '06

re: -> Image submit buttons OK in Firefox, not in IExplorer. Why? <-


Message-ID: <gahgn2hug423eeoj0pm3f9ovmpjq4ju05g@4ax.comfrom Steve
JORDI contained the following:
Quote:
>Oh well, I'll force the user to use FireFox.
Nice idea. Not terribly scalable though.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jerry Stuckle
Guest
 
Posts: n/a
#6: Dec 7 '06

re: -> Image submit buttons OK in Firefox, not in IExplorer. Why? <-


ED wrote:
Quote:
"Jerry Stuckle" <jstucklex@attglobal.netwrote in message
news:75qdnbctefb-p-XYnZ2dnUVZ_t-mnZ2d@comcast.com...
>
Quote:
>>Steve JORDI wrote:
>>
Quote:
>>>Just a question using images as submit buttons and PHP4.4.4.
>>>It seems that my code correctly works in FireFox but not in IExplorer.
>>>
>>>For example, I have a FORM with 2 buttons called "search" and "save".
>>>In a second file, the one mentioned in the "action" parameter,
>>>I test which button has been clicked in order to decide which action
>>>to take.
>>>
>>>IExplorer doesn't get anything, FireFox correctly works.
>>>
>>>Example:
>>>
>>>file main.php
>>>=============
>>><form id="myform" name="myform" method="post" action="process.php">
>>>...
>>><INPUT name="search" type="image" value="search"
>>>src="images/search.gif" alt="search" />
>>><INPUT name="save" type="image" value="save"
>>>src="images/save.gif" alt="save" />
>>></form>
>>>
>>>file process.php
>>>================
>>>echo "***".$_POST."<BR>" ; // Always returns an empty Array
>>>if( isset($_POST['search'])) {
>>>header("Location: ./search.php") ;
>>>}
>>>else if( isset($_POST['save'])) {
>>>header( "Location: ./save.php" ) ;
>>>}
>>>else {
>>>echo "Houston, we've got a problem<br />" ;
>>>}
>>>
>>>
>>>Firefox correctly sees the variables "search" and "save". Internet
>>>explorer always "contacts Houston".
>>>
>>>I have tried to name my two INPUT to "submit"
>>>
>>><INPUT name="submit" type="image" value="search"
>>>src="images/search.gif" alt="search" />
>>><INPUT name="submit" type="image" value="save"
>>>src="images/save.gif" alt="save" />
>>>
>>>and then check the value of the submit, using
>>>
>>>if( $_POST['submit'] == 'search' )...
>>>
>>>Doesn't work in IExplorer.
>>>
>>>
>>>Then I checked to see whether I have the search_x or save_x variable
>>>that are supposedly automatically created, but they don't exist in
>>>neither browser.
>>>That's why my echo $_POST returns nothing.
>>>
>>>What's wrong here?
>>>Any help would be greatly appreciated.
>>>
>>>Thanks in advance.
>>>
>>>
>>>
>>>
>>>Sincerely,
>>>Steve JORDI
>>>
>>>(Remove the K_I_L_LSPAM from my email address)
>>>------------------------------------------------
>>>1197 Prangins Email: stevejordiK_I_L_LSPAM@hotmail.com
>>>Switzerland WWW: www.sjordi.com
>>>------------------------------------------------
>>>Volcanoes at www.sjordi.com/volcanoes
>>>MovieDB at www.sjmoviedb.com
>>>------------------------------------------------
>>
>>Nothing's wrong with your code. IE's broke. For image buttons it only
>>sends the x and y coordinates of the selection, not the value. IIRC, the
>>correct values are $_POST['submit.x'] and $_POST['submit.y'] (which
>>Firefox also correctly sends).
>>
>>
>>--
>>==================
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>jstucklex@attglobal.net
>>==================
>
>
>
Actually, I think the correct vars are $_POST['submit_x'] and
$_POST['submit_y']
(with underscore).
>
cheers,
ED
>
>
Yes, you're correct, Ed. Thanks for the correction!


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Closed Thread