Hi Suz,

Well, since Suz accidentally posted this question to the list, I guess I
might as well accidentally respond to the list:

> Care to hazard a guess as to why they aren't working? Here's my "monkeyed
> around with version" and below is it the graphics version that works OK.
> I've stripped out style and table tags to make it easier to read:

> <FORM action="http://www.cartserver.com/sc/cart.cgi" method=POST>
> <A
> HREF="http://www.cartserver.com/sc/cart.cgi?item=a-3003^TLCDVDR^TL
> CDVD-ROM^45.00
> ^1^5.50&add.x=1"><B>Order Now</B></A>
> <INPUT type=hidden name=item value="a-3003^TLCDVDR^TLC
> DVD-ROM^45.00^1^5.50">
> </FORM>

OK. Since you are no longer using an image button to submit the information
from your form all the information must be passed in the url. So, you can do
this for th passage above:

<A
HREF="http://www.cartserver.com/sc/cart.cgi?item=a-3003^TLCDVDR^TLCDVD-ROM^4
5.00^1^5.50&add.x=1">
        <B>Order Now</B>
</A>

You can remove the the <form> tags, unless there are other form elements
that go between them. If there *are* form elements, but no type=submit or
type=image tags, then you can remove the hidden tag because the value of the
hidden item only passed to the script via a click on a submit or type=image
button situated between the <form> and </form> tags. You can also just use
<form>, without the action= and method= parts if the script is not being
called via a type=submit or type=image click. So, you may not even need the
<form tag at all, unless you need it to contain other form (input) elements,
such as input type=text, etc.

You have correctly added the item=... to the url in your href (you just
stick a ? on the end of the url, then add the value pair: item=xyzpdq, or,
if there's already a ? mark in the url, then add the value pair to the end,
using a & mark to seperate it from the rest: &item=xyzpdq).

Now, to make the next one work the same way you must also move the value
pair to the end of the url in the href:

<A
HREF="http://www.cartserver.com/sc/cart.cgi?item=a-3003+name=view&add.x=1">
        <B>View Order</B>
</A>
<B>|</B>

same here (notice I added the item=a-3003 to the url:

<INPUT TYPE=hidden name=item VALUE="a-3003">
<A
HREF="http://www.cartserver.com/sc/cart.cgi?item=a-3003&name=checkout&add.x=
1>
</a>
<B>Checkout Now</B>

If you haven't noticed yet, the value pairs are separated by the & symbol,
as in:

url?name=bob&town=Boston&color=puce

If you notice, in the code there is a value pair called name, where
name=view or name=checkout. This tells the script, cart.cgi, how to act. The
script looks for what the value of "name" is and then acts accordingly. The
value pair is arranged with the NAME of the variable on the first side of
the equal sign and the VALUE of the variable on the other side. So, a tag
such as this:

<input type="text" name="first_name" value="Ted">

sends this pair to the script: first_name=Ted

The odd, and not recommended thing that this script writer did is that they
used the word "name" as a name, so their tag would look like this:

<input type="text" name="name" value="Ted">

Notice the name="name". That can get confusing when debugging code and doing
search and replaces while writing the script, so I recommend against it,
FWIW. It's better to use something other than "name", as in the example
using name="first_name".

Capish?

Jack

____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to