Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Making a Submit button do 2 things

New Here ,
Jun 21, 2007 Jun 21, 2007
I have a simple asp page that inserts a new record into an Access db. I used Dreamweaver's insert record wizard to create it and it works fine.

When the user clicks the "submit" button that actually inserts the record into the database, I'd like to have it also automatically send an email to someone notifying them that a new record has been added. I'd be content with it just having a sentence in the subject line, with nothing in the message area.

Can it be done? If so, how?
TOPICS
Server side applications
333
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 21, 2007 Jun 21, 2007
It is fairly easy. All you need to do is grab some email code and insert it
in the insert code just above where it does the response.redirect to go to
your success page.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"jwcrosby" <webforumsuser@macromedia.com> wrote in message
news:f5euiq$fj7$1@forums.macromedia.com...
>I have a simple asp page that inserts a new record into an Access db. I
>used
> Dreamweaver's insert record wizard to create it and it works fine.
>
> When the user clicks the "submit" button that actually inserts the record
> into
> the database, I'd like to have it also automatically send an email to
> someone
> notifying them that a new record has been added. I'd be content with it
> just
> having a sentence in the subject line, with nothing in the message area.
>
> Can it be done? If so, how?
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 22, 2007 Jun 22, 2007
I'm sorry, Paul, but I don't know where to "grab some email code" or even what it might look like. Here is the snippet of code for the response.redirect. Could you show me where to insert the code you mentioned and I'll at least know that much. I'll look for the "email code" elsewhere unless it's something easily you'd care to share.

Dim MM_editRedirectUrl
MM_editRedirectUrl = "index.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)

Thanks.

Jerry
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2007 Jun 22, 2007
LATEST
> Dim MM_editRedirectUrl
> MM_editRedirectUrl = "index.asp"
> If (Request.QueryString <> "") Then
> If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
> MM_editRedirectUrl = MM_editRedirectUrl & "?" &
> Request.QueryString
> Else
> MM_editRedirectUrl = MM_editRedirectUrl & "&" &
> Request.QueryString
> End If
> End If

**** EMAIL CODE GOES HERE *****


> Response.Redirect(MM_editRedirectUrl)
>
> Thanks.
>
> Jerry
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines