|
| |
|
|
jolopo27
Posts: 1 Joined: 2/23/2004 Status: offline
|
how do i change hidden field names? - 2/23/2004 17:47:11
i need to post the information from one form into another (paypal checkout). how do i change the field names? the form is in vb script and is referring to fields within a database. the code i have now is this: <%@ Language=VBScript %> <% If Session("Validated") <> True Then Response.Redirect("default.asp") End If CartArray = Session("Cart") CartLength = Session("CartLength") ' Determine Shipping Table If Request.Form("ShipTo_Country") = "United States" Then SQLStr = "SELECT * FROM Shipping_Table ORDER BY LevelID" Else SQLStr = "SELECT * FROM International_Shipping_Table ORDER BY LevelID" End If Set RsShipping = Session("JiffyDB").Execute(SQLStr) ' Sum All Totals I = 0 Sum = 0 Shipping = 0.0 While I < CartLength SQLStr = "SELECT UnitPrice FROM Products_Table WHERE ProductID = " & CartArray(I, 0) Set RsPrice = Session("JiffyDB").Execute(SQLStr) J = 0 While J < CartArray(I, 1) Sum = Sum + RsPrice("UnitPrice") ' Option Price (Until End Comments) SQLStr = "SELECT * FROM Product_Options_Table WHERE OptionID = " & CartArray(I, 2) Set RsTemp = Session("JiffyDB").Execute(SQLStr) If Not RsTemp.EOF Then Sum = Sum + RsTemp("PriceDifference") End If SQLStr = "SELECT * FROM Product_Options2_Table WHERE OptionID = " & CartArray(I, 3) Set RsTemp2 = Session("JiffyDB").Execute(SQLStr) If Not RsTemp2.EOF Then Sum = Sum + RsTemp2("PriceDifference") End If ' End Option Price Code J = J + 1 WEnd I = I + 1 WEnd While Not RsShipping.EOF If (Sum >= RsShipping("LevelMinimum") And Sum <= RsShipping("LevelMaximum")) Or (Sum >= RsShipping("LevelMinimum") And RsShipping("LevelMaximum") < 0) Then Shipping = RsShipping("ShippingCharge") End If RsShipping.MoveNext WEnd ' Get Personal Information Session("ShipName") = Request.Form("ShipTo_Name") Session("ShipAddress") = Request.Form("ShipTo_Address") Session("ShipCity") = Request.Form("ShipTo_City") Session("ShipState") = Request.Form("ShipTo_State") Session("ShipZip") = Request.Form("ShipTo_Zip") Session("ShipCountry") = Request.Form("ShipTo_Country") Session("Phone") = Request.Form("ShipTo_Phone") Session("Email") = Request.Form("Email") If Len(Request.Form("BillTo_Name")) > 1 Then Session("BillName") = Request.Form("BillTo_Name") Else Session("BillName") = Request.Form("ShipTo_Name") End If If Len(Request.Form("BillTo_Address")) > 1 Then Session("BillAddress") = Request.Form("BillTo_Address") Else Session("BillAddress") = Request.Form("ShipTo_Address") End If If Len(Request.Form("BillTo_City")) > 1 Then Session("BillCity") = Request.Form("BillTo_City") Else Session("BillCity") = Request.Form("ShipTo_City") End If If Request.Form("BillTo_State") <> "- Pick State -" Then Session("BillState") = Request.Form("BillTo_State") Else Session("BillState") = Request.Form("ShipTo_State") End If If Len(Request.Form("BillTo_Zip")) > 1 Then Session("BillZip") = Request.Form("BillTo_Zip") Else Session("BillZip") = Request.Form("ShipTo_Zip") End If If Len(Request.Form("BillTo_Zip")) > 1 Then Session("BillCountry") = Request.Form("BillTo_Country") Else Session("BillCountry") = Request.Form("ShipTo_Country") End If SQLStr = "SELECT * FROM Credit_Cards_Table WHERE CreditCardID = " & Request.Form("CreditCard") Set RsCardInfo = Session("JiffyDB").Execute(SQLStr) Session("CreditCardID") = RsCardInfo("CreditCardID") Session("CreditCardName") = RsCardInfo("CreditCardName") Session("CreditCardNumber") = Request.Form("CC_Number") Session("CreditCardExpireMonth") = Request.Form("Month") Session("CreditCardExpireYear") = Request.Form("Year") Session("Comments") = Request.Form("Comments") ' Calculate Sales Tax If Session("BillState") = Session("TaxState") Then Tax = Sum * (Session("TaxRate")/100) Else Tax = 0 End If %> <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft FrontPage 6.0"> </HEAD> <% If Len(Session("BackgroundImage")) > 0 Then Response.Write("<BODY BACKGROUNDIMAGE=""" & Session("BackgroundImage") & """>" & vbCrLf) Else Response.Write("<BODY>" & vbCrLf) End If %> <% If Len(Session("HeaderImage")) > 0 Then Response.Write("<CENTER><IMG SRC=""" & Session("HeaderImage") & """></CENTER><BR>" & vbCrLf) Else Response.Write("<H1 ALIGN=""Center""><FONT FACE=""Arial""></FONT></H1>") End If %> <body bgcolor="#ECECFF"> <P align="center" style="margin-top: 0; margin-bottom: 0"> <div align="center"> <TABLE WIDTH="650" bgcolor="#ECECFF"> <TR> <TD align="center"> <p style="margin-top: 0; margin-bottom: 0"> <p style="margin-top: 0; margin-bottom: 0"> <b><font face="ARIAL" size="5">Order Confirmation</font></b><p style="margin-top: 0; margin-bottom: 0"> <p style="margin-top: 0; margin-bottom: 0"> <FONT face=ARIAL size=2><B>Review your selection and pricing information carefully. When you click the button below, your order will be processed immediately. You will then enter your credit card information securely on the following page. An email confirmation of your order will be sent to you.</B></FONT><p style="margin-top: 0; margin-bottom: 0"></TD> </TR> </TABLE> </div> <div align="center"> <table border="1" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" height="361"> <tr> <td bgcolor="#0000FF" colspan="2" style="color: #FFFFFF; font-weight: bold" height="19"> <p style="margin-top: 0; margin-bottom: 0"><b><font face="Arial" size="3">Ship To:</font></b></td> <td bgcolor="#0000FF" style="color: #FFFFFF; font-weight: bold" height="19"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#0000FF" colspan="2" style="color: #FFFFFF; font-weight: bold" height="19"> <p style="margin-top: 0; margin-bottom: 0"> </td> </tr> <tr> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="19"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="19"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="19"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="19"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" height="19" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF"> <p style="margin-top: 0; margin-bottom: 0"></td> </tr> <tr> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="10" bordercolordark="#0000FF"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="10" bordercolordark="#0000FF"><FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=Session("ShipName")%></FONT><p style="margin-top: 0; margin-bottom: 0"><br></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="10" bordercolordark="#0000FF"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="10" bordercolordark="#0000FF"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" height="10" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF"><FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=Session("BillName")%></FONT><p style="margin-top: 0; margin-bottom: 0"><br></td> </tr> <tr> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="57" bordercolordark="#0000FF"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="57" bordercolordark="#0000FF"><FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=Session("ShipAddress")%></FONT><p style="margin-top: 0; margin-bottom: 0"><br></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="57" bordercolordark="#0000FF"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="57" bordercolordark="#0000FF"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" height="57" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF"><FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=Session("BillAddress")%></FONT><p style="margin-top: 0; margin-bottom: 0"><br></td> </tr> <tr> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="35"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="35"><FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=Session("ShipCity")%>, <%=Session("ShipState")%> <%=Session("ShipZip")%></FONT><br></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="35"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="35"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="35"><FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=Session("BillCity")%>, <%=Session("BillState")%> <%=Session("BillZip")%></FONT><br></td> </tr> <tr> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="57" bordercolordark="#0000FF"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="57" bordercolordark="#0000FF"><FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=Session("ShipCountry")%></FONT><p style="margin-top: 0; margin-bottom: 0"><br></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="57" bordercolordark="#0000FF"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" height="57" bordercolordark="#0000FF"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" height="57" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF"><FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=Session("BillCountry")%></FONT><p style="margin-top: 0; margin-bottom: 0"><br></td> </tr> <tr> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="19"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="19"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="19"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="19"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="19"> <p style="margin-top: 0; margin-bottom: 0"></td> </tr> <tr> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="35"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="35"> <p style="margin-top: 0; margin-bottom: 0"><FONT FACE="Arial" SIZE="2">Phone Number: <%=Session("Phone")%></FONT><br></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="35"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="35"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="35"><FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=Trim(RsCardInfo("CreditCardName"))%> <%=Request.Form("CC_Number")%></FONT><br></td> </tr> <tr> <td bgcolor="#ECECFF" width="24" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="38"> <p style="margin-top: 0; margin-bottom: 0"></td> <td width="217" bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="38"> <p style="margin-top: 0; margin-bottom: 0"><FONT FACE="Arial" SIZE="2">Email Address: <%=Session("Email")%></FONT><br></td> <td bgcolor="#ECECFF" width="19" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="38"> <p style="margin-top: 0; margin-bottom: 0"></td> <td bgcolor="#ECECFF" width="24" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="38"> <p style="margin-top: 0; margin-bottom: 0"></td> <td width="209" bgcolor="#ECECFF" style="color: #000000; font-weight: bold" bordercolor="#0000FF" bordercolordark="#0000FF" height="38"> <p style="margin-top: 0; margin-bottom: 0"><br></td> </tr> </table> </div> <p style="margin-top: 0; margin-bottom: 0"> </p> <table border="1" width="100%"> <tr> <td width="10%" bgcolor="#0000FF" style="color: #FFFFFF"> <p style="margin-top: 0; margin-bottom: 0"><font face="Arial" size="2"><b>QUANTITY</b></font></td> <td width="60%" bgcolor="#0000FF" style="color: #FFFFFF"> <p style="margin-top: 0; margin-bottom: 0"><font face="Arial" size="2"><b>PRODUCT</b></font></td> <td width="15%" bgcolor="#0000FF" style="color: #FFFFFF"> <p style="margin-top: 0; margin-bottom: 0"><font face="Arial" size="2"><b>UNIT PRICE</b></font></td> <td width="15%" bgcolor="#0000FF" style="color: #FFFFFF"> <p style="margin-top: 0; margin-bottom: 0"><font face="Arial" size="2"><b>TOTAL PRICE</b></font></td> </tr> <% I = 0 While I < CartLength SQLStr = "SELECT * FROM Products_Table WHERE ProductID = " & CartArray(I, 0) Set RsProduct = Session("JiffyDB").Execute(SQLStr) ' Option Price (Next Line Only) UnitPrice = RsProduct("UnitPrice") %> <tr> <td width="10%" style="font-weight: bold" bgcolor="#FFFFFF"> <p style="margin-top: 0; margin-bottom: 0"><%=CartArray(I, 1)%> </td> <td width="50%" style="font-weight: bold" bgcolor="#FFFFFF"> <p style="margin-top: 0; margin-bottom: 0"><%=Trim(RsProduct("ProductName"))%><% SQLStr = "SELECT * FROM Product_Options_Table WHERE OptionID = " & CartArray(I, 2) Set RsTemp = Session("JiffyDB").Execute(SQLStr) If Not RsTemp.EOF Then Response.Write(" (" & Trim(RsTemp("OptionName")) & ")") ' Option Price (Next Line) UnitPrice = UnitPrice + RsTemp("PriceDifference") End If SQLStr = "SELECT * FROM Product_Options2_Table WHERE OptionID = " & CartArray(I, 3) Set RsTemp2 = Session("JiffyDB").Execute(SQLStr) If Not RsTemp2.EOF Then Response.Write(" (" & Trim(RsTemp2("OptionName")) & ")") ' Option Price (Next Line) UnitPrice = UnitPrice + RsTemp2("PriceDifference") End If %><p style="margin-top: 0; margin-bottom: 0"> </td> <td width="15%" style="font-weight: bold" bgcolor="#FFFFFF"> <p style="margin-top: 0; margin-bottom: 0"><%=FormatCurrency(UnitPrice)%> </td> <td width="15%" style="font-weight: bold" bgcolor="#FFFFFF"> <p style="margin-top: 0; margin-bottom: 0"><%=FormatCurrency(CartArray(I, 1) * UnitPrice)%> </td> </tr> <% I = I + 1 WEnd If I = 0 Then %> <TR> <TD COLSPAN="5" align="center" bgcolor="#FFFFFF"> <p style="margin-top: 0; margin-bottom: 0"> <FONT FACE="Arial" SIZE="2">Your Cart is Empty.</FONT> </TD> </TR> <% End If %> </table> <p style="margin-top: 0; margin-bottom: 0"><BR> </p> <TABLE ALIGN="Center"> <TR> <TD align="right"> <p style="margin-top: 0; margin-bottom: 0"> <FONT FACE="Arial" SIZE="2"><B>Subtotal: </B></FONT> </TD> <TD align="right"> <FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=FormatCurrency(Sum)%></FONT> </TD> <TD ROWSPAN="4" WIDTH="74"> <p style="margin-top: 0; margin-bottom: 0"></TD> <form action="PlaceOrder.asp" method="post"><TD ROWSPAN="4"> <p style="margin-top: 0; margin-bottom: 0"> <INPUT TYPE="submit" VALUE="-> Process Order and Continue to Secure Credit Card Page ->" NAME="Order"><p style="margin-top: 0; margin-bottom: 0"> <b><font color="#FF0000">NOTE: You will enter your credit card information securely on the following page. Please do not click on the button above until you have carefully reviewed your order. Pressing the button multiple times could result in the processing of multiple orders .</font></b></TD></form> </TR> <TR> <TD align="right"> <p style="margin-top: 0; margin-bottom: 0"> <FONT FACE="Arial" SIZE="2"><B>Sales Tax:</B></FONT></TD> <TD align="right"> <FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=FormatCurrency(Tax)%></FONT></TD> </TR> <TR> <TD align="right"> <p style="margin-top: 0; margin-bottom: 0"> <FONT FACE="Arial" SIZE="2"><B>Shipping Charges: </B></FONT> </TD> <TD align="right"> <FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=FormatCurrency(Shipping)%></FONT> </TD> </TR> <TR> <TD HEIGHT="1" COLSPAN="2" BGCOLOR="Black"> <p style="margin-top: 0; margin-bottom: 0"> </TD> </TR> <TR> <TD align="right"> <p style="margin-top: 0; margin-bottom: 0"> <FONT FACE="Arial" SIZE="2"><B>Total: </B></FONT> </TD> <TD align="right"> <FONT FACE="Arial" SIZE="2"> <p style="margin-top: 0; margin-bottom: 0"><%=FormatCurrency(Sum + Tax + Shipping)%></FONT> </TD> </TR> </TABLE> <p style="margin-top: 0; margin-bottom: 0"> </BODY> </HTML> i need to change the fields so that they match up with paypal's form which is: <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="you@youremail.com"> <input type="hidden" name="item_name" value="Item Name"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="amount" value="0.00"> <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> HELP!
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: how do i change hidden field names? - 2/23/2004 21:42:39
Forgive me if I am oversimplifying this. All that matters is that form 1 has all the information needed in form 2. The field names can differ. You just need to pass values from one field to another. For example, if in the PayPal field named business, you need the user's email from form 1, you would do this: <input type="hidden" name="business" value="<%=Session("Email")%>"> Is that what you are trying to do???
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|