View Full Version : ASP Help
Nick Toye
10-31-2003, 09:49 AM
Hello,
I'm fairly new to the asp thing so I need a little help.
I have a flash form that sends variables to an asp file on my server.
Below is my asp file/script
<%
Dim reply_number, reply_restaurant, reply_day, reply_month, reply_year, reply_time, returnToFlash
reply_number = Request.Form("number")
reply_restaurant = Request.Form("restaurant")
reply_day = Request.Form("day")
reply_month = Request.Form("month")
reply_year = Request.Form("year")
reply_time = Request.Form("time")
returnToFlash = "reply_number=" & Server.URLEncode(reply_number) & "&reply_restaurant=" & Server.URLEncode(reply_restaurant) & "&reply_day=" & Server.URLEncode(reply_day) & "&reply_month=" & Server.URLEncode(reply_month) & "&reply_year=" & Server.URLEncode(reply_year) & "&reply_time=" & Server.URLEncode(reply_time)
Response.Write returnToFlash
%>
The thing is I need to add two fields to it from my flash form. Two text boxes that allow the user to enter their name and email address. I also need to email the results of the form my email address. What piece of code do I need to add.
Thanks very much in advance
Nick
pippen
10-31-2003, 12:05 PM
Hi Nick,
I am afraid it looks like you are going the long way around things.
What it looks like is, you are trying to get your users to submit information in a flash file and then this information is to be passed to another page where it can either be
A) inserted to a database
B) Displayed (but you could just use flash for that?)
Could you give me abit more information and i could sort this out for you.
I have over 7 years experience in ASP so this can be a quick solution.
If you have any other queries then please post them again and i will respond.
Cheers
pippen
10-31-2003, 12:09 PM
Me again......
I didn't see the base of your message..... sorry :(
You will need to know if your server has a ASPmail, or if it handles CDONTS, if it does i will let you have the code
Cheers
Nick Toye
10-31-2003, 12:11 PM
Hi thanks for replying,
The server I am using does handle CDONTS (whatever that is?)
Where in Liverpool are you based, I'm in Chester, but used to work in Birkenhead.
Nick
pippen
10-31-2003, 12:23 PM
Hi Nick,
I used to work in Birkenhead, in Hamilton Square many years ago. I now work Freelance in Liverpool for a company called BMG.
Here is two ways for you to send the email
Text Email
<%
Dim MyBody
Dim MyCDONTSMail
%>
<%
Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.From= "somebody@nowhere.com"
MyCDONTSMail.To= "nobody@nowhere.com"
MyCDONTSMail.Subject="This is a Test"
MyBody = "Thank you for ordering that stuff" & vbCrLf
MyBody = MyBody & "We appreciate your business" & vbCrLf
MyBody = MyBody & "Your stuff will arrive within 7 business days"
MyCDONTSMail.Body= MyBody
MyCDONTSMail.Send
set MyCDONTSMail=nothing
%>
or you can use this to send HTML emails
<%
Dim MyCDONTSMail2
Dim HTML
Set MyCDONTSMail2 = CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<title>Sending CDONTS Email Using HTML</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body bgcolor=""FFFFFF"">"
HTML = HTML & "<p><font size =""3"" face=""Arial""><strong>"
HTML = HTML & "Name Of Store</strong><br>"
HTML = HTML & "Incoming Customer Order</strong></p>"
HTML = HTML & "<p align = ""center"">Bla Bla Bla Bla Bla</p>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
MyCDONTSMail2.From= "somebody@somewhere.com"
MyCDONTSMail2.To="nobody@somewhere.com"
MyCDONTSMail2.Subject="Incoming Customer Order"
MyCDONTSMail2.BodyFormat=0
MyCDONTSMail2.MailFormat=0
MyCDONTSMail2.Body=HTML
MyCDONTSMail2.Send
set MyCDONTSMail2=nothing
%>
Just change the relevant areas to give you the information.
Hope this is acceptable
Cheers
Nick Toye
10-31-2003, 12:35 PM
Basically the form is for an online booking system for a restaurant.
The form asks for info such as name, email address, date, time, number in party and which branch of restaurant.
When the user clicks submit, I want it to send an email to my client at the restaurant where they can easily read all the information from the form, and then email the user to confirm the booking.
Is it easy to do?
Also what was the company you worked for in Hamilton Square?
Nick
pippen
10-31-2003, 12:46 PM
I have actually done a simple flash to asp page.
Not sure that it will work straight away on yours though.
If you require it then let me know
cheers
Nick Toye
10-31-2003, 12:51 PM
I'll have a look at it.
Also would you use ASP to update a text file that is read by flash to populate dynamic text fields?
Sorry to be inquisitive but I can do all the fancy designs, and have the concepts its just the scary backend that scares me, I need to learn it and I think the best way to do that is to see working examples that you can relate to.
Anyway i'm babbling.
pippen
10-31-2003, 12:58 PM
I have actually done a simple flash to asp page.
Not sure that it will work straight away on yours though.
If you require it then let me know
cheers
pippen
10-31-2003, 12:59 PM
Looks like they have a problem on this site. it doesn't normally add to responds
pippen
10-31-2003, 01:03 PM
<%
FirstName = Request.form("FirstName")
Email = Request.form("Email")
Phone = Request.form("Phone")
ToComments = Request.form("ToComments")
HearAbout = Request.form("HearAbout")
strName = "" 'your name
strEmail = "" 'your email
strSubject = "Online Email Enquiry/Comment"
strBody = "The following is from the CONTACT form ." & VbCrLf & VbCrLf
strBody = strBody & "Name:" & VbCrLf & FirstName & VbCrLf & VbCrLf
strBody = strBody & "Comments:" & VbCrLf & ToComments & VbCrLf & VbCrLf
strBody = strBody & "Where did you hear about:" & VbCrLf & HearAbout & VbCrLf & VbCrLf
strBody = strBody & "Phone:" & VbCrLf & Phone & VbCrLf & VbCrLf
strBody = strBody & "Email:" & VbCrLf & Email & VbCrLf & VbCrLf
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "" ' your email hosts i.e freeserve.net or btinternet.com
Mailer.FromName = FirstName
Mailer.FromAddress = Email
Mailer.AddRecipient strName, strEmail
Mailer.AddRecipient "", "" ' Recipients name, email address
Mailer.Subject = (strSubject)
Mailer.BodyText = strBody
if Mailer.SendMail then
Response.Write "_root.contact open.emailenter.EmailStatus=Complete - Mail sent"
else
Response.Write "_root.contact open.emailenter.EmailStatus=Failure - Mail errors"
Response.Write Mailer.Response
end if
%>
<%
Set Mailer = nothing
%>
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.