1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to send results of a ASP shopping cart?

Discussion in 'C#' started by illtrax, Aug 28, 2006.

  1. #1
    Hey Everybody,
    I am very new to ASP. I have been trying to create an oonline menu for a cafe. I have used html, then JavaScript and then I was told to forget about Java and go with ASP.
    So I did. I found this script and I like it but there is one problem, I don't know how to get the information on the final page to send. I know how to change everything but that.

    The sample page of the code is provided at
    www.asp101.com/samples/shopping.asp
    and the code is displayed at
    www.asp101.com/samples/viewasp.asp?file=shopping%2Easp

    On the last page I would like to have them input there name, address, telephone number and email then be able to send the email to me.
    I think I have to do something at the bottom around "Thank you for your order!" I tried a few things but no go.
    Thanks for any help you may offer!!
     
    illtrax, Aug 28, 2006 IP
  2. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #2
    you need to make the changes here

    <%
    Case "checkout"
    PlaceOrder
    %>
    </TD></TR>
    <TR><TD ALIGN="left">
    <BR>
    <H2>Thank you for your order!</H2>
    If this had been an actual shopping cart, this is where you would have had them enter
    their personal information and payment method and then taken care of any backend
    processing before finalizing their order. However as this is a shopping cart sample
    and this is where security becomes a problem, we'll leave it for a future sample.


    I'd suggest you create another case when the info is submitted and when its not

    here is how it'll look like
    <%
    Case "checkout"
    PlaceOrder
    %>
    <%
    if request("name")="" then strError="Please enter your name."
    if request("address")="" then strError=strError & " Please enter your address."
    if request("telephone")="" then strError=strError & " Please enter your telephone."
    if request("email")="" then strError=strError & " Please enter your email."
    if strError<>"" then
    %>
    </TD></TR>
    <TR><TD ALIGN="left">
    <form>
    </form>
    <%else%>
    </TD></TR>
    <TR><TD ALIGN="left">
    <BR>
    <H2>Thank you for your order!</H2>
    If this had been an actual shopping cart, this is where you would have had them enter
    their personal information and payment method and then taken care of any backend
    processing before finalizing their order. However as this is a shopping cart sample
    and this is where security becomes a problem, we'll leave it for a future sample.
    <%end if%>


    don't forget to have a hidden input named "action" and value set to "checkout" to complete the order successfully

    Hope this helps

    Regards
     
    ludwig, Aug 28, 2006 IP
  3. illtrax

    illtrax Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the relpy.
    I did the changes but it did not work.
    What I would like is to have the order that appers on the top of the page to sent with the email as well. I know how to make a form with name, address, etc and have it varified (but thanks for that too) and sent to my email.
    How can I make it send the order?

    Here is your edited code and some stuff I added just for a test.
    		<%
    Case "checkout"
    PlaceOrder
    %>
    <%
    if request("name")="" then strError="Please enter your name."
    if request("address")="" then strError=strError & " Please enter your address."
    if request("telephone")="" then strError=strError & " Please enter your telephone."
    if request("email")="" then strError=strError & " Please enter your email."
    if strError<>"" then
    %>
    </TD></TR>
    <TR><TD ALIGN="left">
    <form method=post action="gdform.asp" name="emailform">
    <input type="hidden" name="action" value="checkout">
    <br>Name<input type="text" name="name" size="15">
    <br>Address<input type="text" name="address" size="15">
    <input name="Submit" type="Submit" value="Siparişi Gönder!">
    </form>
    <%else%>
    </TD></TR>
    <TR><TD ALIGN="left">
    <%end if%>
    Code (markup):
    Here is the email I get back.

    Submit: Sipari?i Gnder!
    action: checkout
    address: test
    name: jessy

    I need the order with the email... Any thoughts?
    Thanks for you efforts so far.
     
    illtrax, Aug 28, 2006 IP