[thelist] Converting a loop into Sendmail
FayeC
fayec at canada.com
Thu Aug 2 11:47:59 CDT 2001
Hi,
I have the following code on a checkout page and I need to convert it
and be able to add that info to a sendmail.
The sendmail I am using doesn't show the product and gives me an error
when I add the variable "quantity" to it...
I have tried to find the answer by myself but even my *very thick* Wrox
books haven't helped me...
I am now looking for help on this list.
If any of you could help me write a sendmail that would use the
variables from this table (Product, price, quantity, total, user name,
surname, address)
I would be very grateful.
Let me know if you need more information than what I have pasted here.
Thank you in advance,
FayeC
<table border="1" cellpadding="4" cellspacing="0" width="80%">
<tr>
<td>Product</td>
<td>Price</td>
<td>Quantity</td>
<td>Total for this product</td>
</tr>
<%
WHILE NOT cartRS.EOF
orderSubTotal = orderSubTotal + (cartRS("product_price") *
cartRS("cart_quantity"))
%>
<tr>
<td><b><%= cartRS("product_name") %></b></td>
<td align="right"><b><%=FormatCurrency( cartRS ("product_price"))
%></b></td>
<td align="center"><b><%= cartRS ("cart_quantity") %></b></td>
<td align="right"><% productTotal = cartRS("product_price") *
cartRS("cart_quantity") %><b><%=FormatCurrency(productTotal) %></b></td>
</tr>
<%
cartRS.MoveNext
WEND
%>
<%
Dim userRS
sqlString = "SELECT * FROM users WHERE user_id=" & userID
Set userRS = Con.Execute(sqlString)
WHILE NOT userRS.EOF
%>
<tr>
<td colspan="3" align="right"><font color="red"><b>Shipping
details:</b></font></td>
<td align="right">
<%=userRS("user_firstname") & " " & userRS("user_lastname") %>
<br>
<%=userRS("user_street") %>
<br>
<%=userRS("user_city") & ", " & userRS("user_province") & ", " &
userRS("user_province") & ", " & userRS("user_postalcode") %>
</td>
</tr>
</table>
</center>
<%
userRS.MoveNext
WEND
%>
More information about the thelist
mailing list