Forum Moderators: coopster & phranque

Message Too Old, No Replies

passing form data..do I use CGI?

Trying to email data AND use data in web address

         

pctechguy

7:17 am on Apr 18, 2003 (gmt 0)

10+ Year Member



Ok, I dont know how much sense this is going to make...I have a javascript that confgures PC systems. A user can go to the form, choose different components of the system, and the javascript updates the price of each component as well as the total price of the system. A full working copy of this script can be seen at :

On that script, the submit button transfers the data to a confirmation page on a Yahoo Store server which allows you to check out through Yahoo...I am trying to use PayPal (and eventually when I can afford to, something else like Authorize.net), so Ive modified the form a little bit and have figured out that if I get rid of the references to the yahoo store address and the <input> tags associated with it and put the paypal cart <input> tags in, I can get it to check out through PayPal...the problem is, paypal will only let you know that someone bought a system worth $xxxx. It doesnt tell what options were selected...so what Id like to do is have it so that at the same time that someone submits the order, it also send an email to me with the options selected. So I figure I probably somehow pass the data of the form through a cgi script and have that cgi script use that data to send the email and send to paypal...so I need to send :


<form target="paypal" action="https://www.paypal.com/cgibin/webscr" method="post" class="xgear" style="FONT-SIZE: 8pt" name="calculate">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="name@deleted.com">
<input type="hidden" name="item_name" value="Custom AMD System">
<input type="hidden" name="amount" value="499">

to PayPal (btw, the value for "amount" changes as different items are selected from the dropdowns like the one below...the value for "amount" is referenced by the variable total2), and the same time send what option is selected out of several snipets like this:

<select class="xgear" onchange="get_total();" size="1" name="flashmedia">
<option value="0,--- Optional ---" selected>--- Optional ---</option>
<option value="35,EXT USB 6in1 Flash Media Reader/Writer in Silver [+$35]">
EXT USB 6in1 Flash Media Reader/Writer Silver [+$35]</option>
</select></font></td>

to my email (or an excel spreadsheet would be even better, but lets start with a simple email for now). Ive looked up info on parsing data and stuff, but really dont know if Im looking in the right place cuz it isnt making sense. Im completely ignorant with programming...well, I have done some back in the commodore (Basic) days, but am really just learning JS and CGI. Any pointers or references I can check out that can help me? Thanks.

[edited by: jatar_k at 12:54 pm (utc) on April 18, 2003]
[edit reason] no urls thanks [/edit]

pctechguy

7:27 am on Apr 18, 2003 (gmt 0)

10+ Year Member



BTW - i should probably clarify how I use the total2 variable from the form to update the value for the "amount" input:
Originally, the code had the following, which I assumed added all the values from the 'calculate' form:

document.calculate.total2.value = "$" + showpos(tmp);

so I figured I might as well use the same thing to tell the two values to equal each other, so I added the following right below that:

document.calculate.amount.value = document.calculate.total2.value

so when the submit is hit, it uses the same value from total2 for the value for amount. So I can really pass either value over...not sure if it will matter, but thought Id let you know what I meant by them having the same value. Thanks