PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.info.authoring.html > Form post
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Form post

Réponse
 
LinkBack Outils de la discussion
Vieux 19/04/2008, 00h16   #1
zoomcart.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Form post

Hello and thanks in advance for your .
I have code below that posts form data to a cgi scripted shopping cart
and it works great on my mac/firefox browser, but it doesn't work on
ibm/netscape machines. what gives? apparently the data isn't being
recognized and so the cart defaults to it's home page.
<form name='submit3' action='http://my.com/cart.cgi' method='post'>
<input type='hidden' name='user' value='bighouse'>
<input type='hidden' name='item_name' value='My Product'>
<input type='hidden' name='item_number' value='001'>
<input type='hidden' name='item_price' value='3.95'>
<input type='hidden' name='item_weight' value='0'>
<input type='hidden' name='NOTAX' value=''>
<input type='hidden' name='DOWNLOAD' value='1001.zip'>
<input type='image' src='advertisement.gif' value='Buy and Download
Now' name='add_to_cart'>
</form>
  Réponse avec citation
Vieux 19/04/2008, 01h43   #2
Jonathan N. Little
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form post

zoomcart.com wrote:
> Hello and thanks in advance for your .
> I have code below that posts form data to a cgi scripted shopping cart
> and it works great on my mac/firefox browser, but it doesn't work on
> ibm/netscape machines. what gives? apparently the data isn't being
> recognized and so the cart defaults to it's home page.
> <form name='submit3' action='http://my.com/cart.cgi' method='post'>
> <input type='hidden' name='user' value='bighouse'>
> <input type='hidden' name='item_name' value='My Product'>
> <input type='hidden' name='item_number' value='001'>
> <input type='hidden' name='item_price' value='3.95'>
> <input type='hidden' name='item_weight' value='0'>
> <input type='hidden' name='NOTAX' value=''>
> <input type='hidden' name='DOWNLOAD' value='1001.zip'>
> <input type='image' src='advertisement.gif' value='Buy and Download
> Now' name='add_to_cart'>
> </form>


And the submit but is where? Which version Netscape, since currently RIP...

Also URL far better than your snippet, most likely the problem is in
something you have left out.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
  Réponse avec citation
Vieux 19/04/2008, 02h27   #3
Steven Saunderson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form post

On Fri, 18 Apr 2008 20:43:26 -0400, "Jonathan N. Little"
<lws4art@central.net> wrote:

> zoomcart.com wrote:
> > <form name='submit3' action='http://my.com/cart.cgi' method='post'>
> > <input type='image' src='advertisement.gif' value='Buy and Download
> > Now' name='add_to_cart'>
> > </form>

>
> And the submit but is where? Which version Netscape, since currently RIP...


I thought 'image' functioned as a submit button. Perhaps it isn't
widely supported.
--
Steven
  Réponse avec citation
Vieux 19/04/2008, 02h32   #4
Beauregard T. Shagnasty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form post

zoomcart.com wrote:

> I have code below that posts form data to a cgi scripted shopping cart

....
> <form name='submit3' action='http://my.com/cart.cgi' method='post'>
> <input type='hidden' name='user' value='bighouse'>
> <input type='hidden' name='item_name' value='My Product'>
> <input type='hidden' name='item_number' value='001'>
> <input type='hidden' name='item_price' value='3.95'>


Is that safe?
What will happen if I make a copy of your form and change to:

<input type='hidden' name='item_price' value='0.03'>

Will your cart sell 'My Product' to me for 3¢ ?

--
-bts
-you can still add the shipping
  Réponse avec citation
Vieux 19/04/2008, 03h13   #5
Steven Saunderson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form post

On Sat, 19 Apr 2008 11:27:25 +1000, Steven Saunderson <phelum@Syd.au>
wrote:

> On Fri, 18 Apr 2008 20:43:26 -0400, "Jonathan N. Little"
> <lws4art@central.net> wrote:
>
> > zoomcart.com wrote:
> > > <form name='submit3' action='http://my.com/cart.cgi' method='post'>
> > > <input type='image' src='advertisement.gif' value='Buy and Download
> > > Now' name='add_to_cart'>
> > > </form>

> >
> > And the submit but is where? Which version Netscape, since currently RIP...

>
> I thought 'image' functioned as a submit button. Perhaps it isn't
> widely supported.


I've just tested using Opera and for the 'image' above it would include
'&add_to_cart.x=0&add_to_cart.y=0' in the GET array (presumably the same
for POST). But there is no '&add_to_cart=whatever' and this makes it
different from a submit button.
--
Steven
  Réponse avec citation
Vieux 19/04/2008, 05h45   #6
Jukka K. Korpela
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form post

Scripsit Steven Saunderson:

>>>> <form name='submit3' action='http://my.com/cart.cgi' method='post'>
>>>> <input type='image' src='advertisement.gif' value='Buy and Download
>>>> Now' name='add_to_cart'>
>>>> </form>

...
>> I thought 'image' functioned as a submit button. Perhaps it isn't
>> widely supported.


It's widely supported - widely inconsistently, with different quirks and
oddities. See
http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html
which is very dusty but perhaps suitable in a context where someone
worries about Netscape.

> I've just tested using Opera and for the 'image' above it would
> include '&add_to_cart.x=0&add_to_cart.y=0' in the GET array
> (presumably the same for POST). But there is no
> '&add_to_cart=whatever' and this makes it different from a submit
> button.


That's the "classical" browser behavior. Newer implementations include
the name=value pair, too. The specifications are, as usual, fairly
obscure.

There's the simple solution
<input type="submit" value="Buy">
and this should at least be used in prototypes and debugging, to
distinguish all the problems caused by image submit buttons from other
problems.

Regarding the name=value pair from a submit button (normal or image),
don't count on it. Mostly, a single form should only contain one submit
button to avoid confusion or, in some cases, two or more _equivalent_
submit buttons. The choice between different actions should be made in
some other way, e.g. radio buttons.

The idea of having different buttons for different actions in the same
form, like "Buy" and "Get info", sounds nice, but it fails to work in
general, due to implementation faults. For example, what happens when
the user types text in a text input field and hits Enter, using a
browser where that causes form submission?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 14h26.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11653 seconds with 14 queries