Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old August 13th, 2004, 03:43 PM
Authorized User
 
Join Date: Jul 2004
Location: Chicago, , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Night_Zero
Default

This will be the last of what I need to do hopefully and I hope you get back to me soon. Heh. Todays friday and my last day is next week on tuesday and I'd like to get this finished before then but I appreciate all your help all of you in advance.

Reply With Quote
  #22 (permalink)  
Old August 13th, 2004, 04:05 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by Night_Zero
 Alright. I need to make it so this happens when you click a send button. How do I make the send button then add this code into it?
Do you have a form with ACTION="SOMEFILENAME.asp" If so this code goes into that file. You may go back and see some of my previous replies to this, where I referred OTHER PAGE
Quote:
quote:Also, does it just go anywhere after the other stuff?
Where do you want it to go?

Quote:
quote:Lastly I don't really get how your code works when making the temp files for password username and such.
what do you refer as temp files here?
Quote:
quote:The password should obviously be their password which is gotten from Password in the table and called strPassword. The ID which should be their username should be the ID and is called strLogin.
Fine, Is the EMAILID different from strLogin is what I wanted to know. ... And strEmail should obviously be their email. I can make that out from the variable name
Quote:
quote:Oh, and one more thing. You never answered what this program would do if no email address was listed for a particular client.
It would not do anything, as this code I posted in the previous post, would get executed only when you click send/submit button and based on selection of checkboxes, else it would not harm anyone.
Quote:
quote:Will it just skip over it? Even if they check it, what will happen?
hmmm... I am not sure what to answer to this. What you wanted to happen when they check it, would happen. I hope you wanted to mail those people who were selected...

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #23 (permalink)  
Old August 13th, 2004, 04:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

The following lines go into the file that you specified in FORM action. This code is responsible for mailing.
Dim arrEmails, strSelectedDetails, objMail
...
...
End If

The following code goes into success.asp, which is redirected from the FORM action's page on mailing those Ids successfully, else an error is shown on the same page, without redirecting.
strSelectedDetails = Request.QueryString("MailsSentTo")
...
...
End If
This code displays saying the mail has been sent to so and so EMAILIDs...

Hope that explains.

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #24 (permalink)  
Old August 15th, 2004, 11:14 PM
Authorized User
 
Join Date: Jul 2004
Location: Chicago, , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Night_Zero
Default

Alright, let me try and answer some of your questions so you can answer mine. Yes, I do have a action="filename" but it is in test.asp and is pointed at test.asp. When you open up the page it gives you all the check boxes. I want you to select some then hit a submit button. When you hit the submit button it emails everyone that was checked and then goes to the success.asp page.

My question about where does it go I meant where do I put the code for the submit button and the code for sending the email. Should I just place it after the other code for making the check boxes?

For the temp files I mean the strLogin, strPassword, strEmail etc. Yes, the emailid is different than the login. I'll list them next.
strEmail = Their email address
strLogin = User ID
strPassword = Their password
strName = Their company name which should be CLIENT NAME
These need to be setup the way you set them up before so I can use them in the email address I just don't know how you did it.

As for the names without emails. It is possible when someone runs the program they will select a name that has no email address. My question is will it just crash the program or just skip the name and move on?

Hope this answers your questions. In summary I need to make a submit button and where I should place the code. Then I need a few changes to the email so I can use their ID, Email address, Password and Client name in the email and lastly if this code will ignore names that are selected for emails even if they don't have an email listed.

Reply With Quote
  #25 (permalink)  
Old August 16th, 2004, 03:43 PM
Authorized User
 
Join Date: Jul 2004
Location: Chicago, , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Night_Zero
Default

Last thing about the success page. Will that only work if you are coming from the test.asp page? Or should it display a blank page? At the moment success.asp is just this:

<%Option Explicit%>
<HTML>
<HEAD>
<TITLE>Success Page</TITLE>
</HEAD>
<BODY>

<%
    strSelectedDetails = Request.QueryString("MailsSentTo")
    If len(trim(strSelectedDetails))>0 then
        Response.write "Mails have been sent to the following Email address(es)<br>"
            arrEmails = Split(strSelectedDetails)
            For i = 0 to UBound(arrEmails)
        Response.Write arrEmails(i) & "<br>"
        Next
    End If


%>
</BODY>
</HTML>

That all that is needed?

Reply With Quote
  #26 (permalink)  
Old August 16th, 2004, 04:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

since you have the form action as test.asp(submitting to same page), you got to write those code(that need to work after submit button clicked) on top of the page within ASP tags.
Code:
<%
if request(SubmitButtonName) = SubmitbuttonValue Then
    'the code goes here
End If
%>
SubmitButtonName and SubmitButtonValue are to be taken from your code within FORM.
Quote:
quote:These need to be setup the way you set them up before so I can use them in the email address I just don't know how you did it.
Not sure what you wanted on this.
Quote:
quote:As for the names without emails. It is possible when someone runs the program they will select a name that has no email address. My question is will it just crash the program or just skip the name and move on?
The program will not crash. In that case, you will have to Check if strEmail is empty and then mail as below
Code:
If len(strEmail)>0 then
    objMail.To=strEmail
    objMail.From= "<hidden>@<hidden>.com"
    objMail.Subject= "Password Change"
    objMail.Body= "Hello " & strName & ", This email is to inform you that your password has changed. Your login is " & strLogin & ". Your new password is " & strPassword & ". Please make a note of this in your records. If you have any problems please contact Data Services."
    objMail.AttachFile server.mappath("log.pdf"), "CustomizedAttachementName.pdf"
    objMail.Send
End If
So that for empty email, this code doesn't execute.

Hope that explains.
Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #27 (permalink)  
Old August 16th, 2004, 04:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Last thing about the success page.
Yes, It would display a blank page, if not redirected from test.asp

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #28 (permalink)  
Old August 16th, 2004, 04:40 PM
Authorized User
 
Join Date: Jul 2004
Location: Chicago, , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Night_Zero
Default

Alright.
<%
if request(SubmitButtonName) = SubmitbuttonValue Then
    'the code goes here
End If
%>
SubmitButtonName and SubmitButtonValue are to be taken from your code within FORM.

How do I make a submit button in the asp code is my question actually.



Next you asked what I meant with the code for making strEmail, strLogin, etc. How did you construct them correctly? I need to make a strLogin that is their ID I just don't see how you set strEmail to actually be their email address. At the moment you have this:
arrTemp=split(arrEmails(j),"_")
        strEmail=arrTemp(0)
        strUserName=arrTemp(1)
        strPassword=arrTemp(2)
How do I make that and add a strLogin which is their ID? That is my question.

That should be it, thanks.

Reply With Quote
  #29 (permalink)  
Old August 16th, 2004, 04:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:How do I make a submit button in the asp code is my question actually.
I would suggest you to read some books on HTML to know how to add a form submit button, if that is going to be too tough to know about.
Quote:
quote:How do I make that and add a strLogin which is their ID? That is my question.
I had posted the whole code on how to do that. Please refer to my previous posts and add this strLogin to it the way I have done that with others. Sorry, not trying to be rude, but I can only show you some light on how to do that, rather than doing all of your work.

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #30 (permalink)  
Old August 16th, 2004, 11:59 PM
Authorized User
 
Join Date: Jul 2004
Location: Chicago, , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Night_Zero
Default

Yes, I appreciate all your help and I appreciate the way you're trying to get me to learn. The point of the matter as I said is tomorrow is my last day at the job and I wanted the project done. I also likely won't touch ASP ever again but anyways, thanks for your help.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop over check boxes sams ASP.NET 1.0 and 1.1 Professional 5 July 17th, 2007 06:26 AM
Check Boxes Allan320 Access VBA 3 June 2nd, 2006 05:45 AM
Using check boxes to filter dstein4d Access VBA 13 January 25th, 2006 07:50 PM
Disable Check Boxes sweet4511 VB How-To 22 July 19th, 2005 03:53 PM
Getting value of Dynamic Check boxes kathryne Classic ASP Databases 3 March 19th, 2004 05:44 AM



All times are GMT -4. The time now is 02:31 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.