Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Passing variable from VBScript recordset to FORM
Old 10-25-2006, 04:54 PM Passing variable from VBScript recordset to FORM
Super Talker

Posts: 129
Trades: 0
Hi all, hope someone can shed a little light on this one for me please! I have an asp page created in DW using VBScript. I have on it displayed on a table a recordset, showing one record at a time. i would like to have a PayPal button on the page that when pressed picks up the description and price in that record of the recordset. I already have the recordset (needs new fields adding if this whole thing is possible) thus:

Code:
<tr align="center" valign="middle">
    <td height="30"><span class="style2"><%=(rsSignage.Fields.Item("Caption").Value)%></span></td>
    <td height="30"><span class="style1"></span></td>
    <td height="30"><div align="left"><span class="style2">Picture Ref: <%=(rsSignage.Fields.Item("Image_ref").Value)%></span></div></td>
  </tr>
  <tr>
    <td width="400" height="400" align="center" valign="top"><div align="center">
      <p><img src="<%=(rsSignage.Fields.Item("Image").Value)%>"></p>
      <p><%=(rsSignage.Fields.Item("Large_Image").Value)%></p>
The FORM for the PayPal button is thus:

Code:
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">

  <div align="center">
    <input type="hidden" name="cmd" value="_cart">
  
    <input type="hidden" name="add" value="1">
  
    <input type="hidden" name="bn" value="webassist.dreamweaver.4_0_3">
  
    <input type="hidden" name="business" value="sales@17minutes.co.uk">
  
    <input type="hidden" name="item_name" value="Alan 10x8 inch glossy">
  
    <input type="hidden" name="item_number" value="Alan1">
  
    <input type="hidden" name="amount" value="20">
  
    <input type="hidden" name="currency_code" value="GBP">
  
    <input type="hidden" name="receiver_email" value="sales@17minutes.co.uk">
  
    <input type="hidden" name="mrb" value="R-3WH47588B4505740X">
  
    <input type="hidden" name="pal" value="ANNSXSLJLYR2A">
  
    <input type="hidden" name="no_shipping" value="0">
  
    <input type="hidden" name="no_note" value="0">
  
    <input type="image" name="submit" src="http://images.paypal.com/images/x-click-but22.gif" border="0" alt="Make payments with PayPal - it's fast, free and secure!">
  
</div>
</form>
It would be great to add fields to the database conatining data that I can pass to the "item_name" and "ammount" parameters of the paypal form. Any idea how this can be done please? i'm sure it's simple but I haven't a clue how to do it!

Thanks, Lol

RESOLVED
__________________

Please login or register to view this content. Registration is FREE
- Street Photography

Last edited by Lol999; 10-26-2006 at 04:20 PM.. Reason: problem resolved
Lol999 is offline
Reply With Quote
View Public Profile Visit Lol999's homepage!
 
 
Register now for full access!
Old 10-29-2006, 06:52 AM Re: Passing variable from VBScript recordset to FORM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,523
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
This is the subroutine I use for generating the PayPal form on my catalogue/cart code

Code:
sub PayPal()
' paypal form code
with response
.write "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>" & vbCrLf
.write "<input type='hidden' name='return' value='http://www.domain.com/thanks.asp'>" & vbCrLf
.write "<input type='hidden' name='cancel_return' value='http://www.domain.com/cancel.asp'>" & vbCrLf
.write "<input type='hidden' name='cmd' value='_xclick'>" & vbCrLf
.write "<input type='hidden' name='business' value='sales@domain.com'>" & vbCrLf
.write "<input type='hidden' name='item_name' value='"
.write scItemCode
.write " "
.write scProdInfo
.write "'>" & vbCrLf
.write "<input type='hidden' name='amount' value='"
.write FormatNumber(scItemprice * scItemQty,2)
.write "'>" & vbCrLf
.write "<input type='hidden' name='no_note' value='1'>" & vbCrLf
.write "<input type='hidden' name='currency_code' value='GBP'>" & vbCrLf
.write "<input type='image' src='/images/payment/x-click-but01.gif' border='0' name='submit'"
.write " alt='Make payments with PayPal - fast, free and secure!'"
.write " title='Make payments with PayPal - fast, free and secure!'>" & vbCrLf
.write "</form>" & vbCrLf
end with
end sub
scItemCode is from the recordset carrying the stock ref number
scProdInfo is the Item description (plus size, colour, etc)

scItemPrice & scItemQty are fairly self explanatory
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-29-2006, 10:13 AM Re: Passing variable from VBScript recordset to FORM
Super Talker

Posts: 129
Trades: 0
Hi Chris, thanks for the code will examine it further! I actually found a way to do it in DW by binding recordset fields to the PayPal form. I know a lot of folks sneer at DW but it's great for us beginners .

Cheers, Lol
__________________

Please login or register to view this content. Registration is FREE
- Street Photography
Lol999 is offline
Reply With Quote
View Public Profile Visit Lol999's homepage!
 
Reply     « Reply to Passing variable from VBScript recordset to FORM
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44167 seconds with 12 queries