|
Posted by Jerry Stuckle on 12/08/06 00:15
ED wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:75qdnbctefb-p-XYnZ2dnUVZ_t-mnZ2d@comcast.com...
>
>>Steve JORDI wrote:
>>
>>>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
==================
[Back to original message]
|