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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve JORDI

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

    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("Locatio n: ./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

    #2
    Re: -&gt; Image submit buttons OK in Firefox, not in IExplorer. Why?&lt;-

    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("Locatio n: ./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@attgl obal.net
    =============== ===

    Comment

    • Steve JORDI

      #3
      Re: -&gt; Image submit buttons OK in Firefox, not in IExplorer. Why? &lt;-

      Hi Jerry,

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

      >Nothing's wrong with your code. IE's broke.
      Argh! Stupid IE!
      >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
      ------------------------------------------------

      Comment

      • ED

        #4
        Re: -&gt; Image submit buttons OK in Firefox, not in IExplorer. Why? &lt;-


        "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
        news:75qdnbctef b-p-XYnZ2dnUVZ_t-mnZ2d@comcast.c om...
        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("Locati on: ./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@attgl obal.net
        =============== ===

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

        cheers,
        ED


        Comment

        • Geoff Berrow

          #5
          Re: -&gt; Image submit buttons OK in Firefox, not in IExplorer. Why? &lt;-

          Message-ID: <gahgn2hug423ee oj0pm3f9ovmpjq4 ju05g@4ax.comfr om Steve
          JORDI contained the following:
          >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/

          Comment

          • Jerry Stuckle

            #6
            Re: -&gt; Image submit buttons OK in Firefox, not in IExplorer. Why?&lt;-

            ED wrote:
            "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
            news:75qdnbctef b-p-XYnZ2dnUVZ_t-mnZ2d@comcast.c om...
            >
            >>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="image s/search.gif" alt="search" />
            >>><INPUT name="save" type="image" value="save"
            >>>src="image s/save.gif" alt="save" />
            >>></form>
            >>>
            >>>file process.php
            >>>============ ====
            >>>echo "***".$_POST."< BR>" ; // Always returns an empty Array
            >>>if( isset($_POST['search'])) {
            >>>header("Loca tion: ./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="image s/search.gif" alt="search" />
            >>><INPUT name="submit" type="image" value="save"
            >>>src="image s/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
            >>>Switzerlan d 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@att global.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@attgl obal.net
            =============== ===

            Comment

            Working...