Ask a Question related to Dreamweaver AppDev, Design and Development.
-
innovationlab #1
Can't stay logged in after submitting form
I have several pages in a user only area. I can go from page to page to page
until I submit a form (which goes to my email via formmail), then I have to log
back in to get to another page.
The code for the formmail page is:
Any and all help to stay logged in is greatly appreciated.
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/Clients.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="not_authorized.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" &
Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Session("MM_username") <> "") Then
Recordset1__MMColParam = Session("MM_username")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_Clients_STRING
Recordset1.Source = "SELECT * FROM clients WHERE username = '" +
Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library" -->
<%
Response.Buffer = true
Session.Abandon()
if Request.ServerVariables("REQUEST_METHOD") = "POST" then ' user is
sending their application
' create the e-mail object and set the various fields
Set objMessage = Server.CreateObject("CDO.Message")
objMessage.To = "hiltonl@etsu.edu"
objMessage.From = "Innovation Lab Website"
objMessage.Sender = "hiltonl@etsu.edu"
objMessage.Subject = "Service Request"
BodyText = BodyText & "<p>A request for service</p>"
BodyText = BodyText & "<table>"
BodyText = BodyText & "<tr><td align=left>Name:</td><td>" &
Recordset1.Fields.Item("full").Value& "</td></tr>"
BodyText = BodyText & "<tr><td align=left>Company:</td><td>" &
Recordset1.Fields.Item("company").Value& "</td></tr>"
BodyText = BodyText & "<tr><td align=left>Email:</td><td>" &
Recordset1.Fields.Item("email").Value& "</td></tr>"
BodyText = BodyText & "<tr><td align=leftt>Type:</td><td>" &
Request.Form("type") & "</td></tr>"
BodyText = BodyText & "<tr><td align=left>Description:</td><td>" &
Request.Form("description") & "</td></tr>"
BodyText = BodyText & "</table>"
objMessage.HTMLBody = BodyText
' specify mail server information
set objConfig = Server.CreateObject("CDO.Configuration")
objConfig.Fields(cdoSendUsingMethod) = 2
objConfig.Fields(cdoSMTPServer) = "mail.etsu.edu"
objConfig.Fields(cdoSMTPServerPort) = 25
objConfig.Fields(cdoSMTPAuthenticate) = cdoAnonymous
objConfig.Fields.Update
set objMessage.Configuration = objConfig
' send the message and dispose of the object
objMessage.Send()
set objConfig = Nothing
set objMessage = Nothing
Server.Transfer ("request_thank_you.asp")
'else visitor is going to view the application page
Server.Transfer ("index.htm")
end if
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
innovationlab Guest
-
How to stay logged in
Hello, I have created simple login sistem. I'm using sessions and they expire after I close my browser. How can I stay loged after I have closed... -
Submitting form
Can i know whether any1 know hw to submit our form after validating to another form where we can get the input from the first page for .mxml?? And... -
Use PDf fill in form in Website and submitting form info.
I feel like I'm 99% there, but I am missing something. I created the PDF form offline and tested submitting it. It works fine. When I upload and... -
Submitting Form Var Problem
I have two dropdown list: frm_cbo_top frm_cbo_bottom I have an OnChange="submit_form();" in each of these dropdown lists - the javascript... -
stay on the submitting page
Hi Maybee a little bit of topic, but is it possible to stay on the submitting page once you've clicked submit. This is to get processing done on... -
Paul Whitham TMM #2
Re: Can't stay logged in after submitting form
The problem is this line
Session.Abandon()
This is causing the all sessions to be dropped including MM_Username which
is the one control access.
--
Regards
Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
[url]www.valleybiz.net[/url]
Team Macromedia Volunteer for Ultradev/Dreamweaver MX
[url]www.macromedia.com/support/forums/team_macromedia[/url]
"innovationlab" <webforumsuser@macromedia.com> wrote in message
news:d40gt0$1fn$1@forums.macromedia.com...page> I have several pages in a user only area. I can go from page to page toto log> until I submit a form (which goes to my email via formmail), then I haveThen> back in to get to another page.
>
> The code for the formmail page is:
>
> Any and all help to stay logged in is greatly appreciated.
>
> <%@LANGUAGE="VBSCRIPT"%>
> <!--#include file="Connections/Clients.asp" -->
> <%
> ' *** Restrict Access To Page: Grant or deny access to this page
> MM_authorizedUsers=""
> MM_authFailedURL="not_authorized.asp"
> MM_grantAccess=false
> If Session("MM_Username") <> "" Then
> If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
> (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1)"?" &> MM_grantAccess = true
> End If
> End If
> If Not MM_grantAccess Then
> MM_qsChar = "?"
> If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
> MM_referrer = Request.ServerVariables("URL")
> if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer &> Request.QueryString()
> MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
> Server.URLEncode(MM_referrer)
> Response.Redirect(MM_authFailedURL)
> End If
> %>
> <%
> Dim Recordset1__MMColParam
> Recordset1__MMColParam = "1"
> If (Session("MM_username") <> "") Then
> Recordset1__MMColParam = Session("MM_username")
> End If
> %>
> <%
> Dim Recordset1
> Dim Recordset1_numRows
>
> Set Recordset1 = Server.CreateObject("ADODB.Recordset")
> Recordset1.ActiveConnection = MM_Clients_STRING
> Recordset1.Source = "SELECT * FROM clients WHERE username = '" +
> Replace(Recordset1__MMColParam, "'", "''") + "'"
> Recordset1.CursorType = 0
> Recordset1.CursorLocation = 2
> Recordset1.LockType = 1
> Recordset1.Open()
>
> Recordset1_numRows = 0
> %>
> <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
> NAME="CDO for Windows 2000 Library" -->
> <!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
> NAME="ADODB Type Library" -->
> <%
> Response.Buffer = true
> Session.Abandon()
>
> if Request.ServerVariables("REQUEST_METHOD") = "POST" then ' user is
> sending their application
>
> ' create the e-mail object and set the various fields
> Set objMessage = Server.CreateObject("CDO.Message")
> objMessage.To = "hiltonl@etsu.edu"
> objMessage.From = "Innovation Lab Website"
> objMessage.Sender = "hiltonl@etsu.edu"
> objMessage.Subject = "Service Request"
> BodyText = BodyText & "<p>A request for service</p>"
> BodyText = BodyText & "<table>"
> BodyText = BodyText & "<tr><td align=left>Name:</td><td>" &
> Recordset1.Fields.Item("full").Value& "</td></tr>"
> BodyText = BodyText & "<tr><td align=left>Company:</td><td>" &
> Recordset1.Fields.Item("company").Value& "</td></tr>"
> BodyText = BodyText & "<tr><td align=left>Email:</td><td>" &
> Recordset1.Fields.Item("email").Value& "</td></tr>"
> BodyText = BodyText & "<tr><td align=leftt>Type:</td><td>" &
> Request.Form("type") & "</td></tr>"
> BodyText = BodyText & "<tr><td align=left>Description:</td><td>" &
> Request.Form("description") & "</td></tr>"
> BodyText = BodyText & "</table>"
> objMessage.HTMLBody = BodyText
>
> ' specify mail server information
> set objConfig = Server.CreateObject("CDO.Configuration")
> objConfig.Fields(cdoSendUsingMethod) = 2
> objConfig.Fields(cdoSMTPServer) = "mail.etsu.edu"
> objConfig.Fields(cdoSMTPServerPort) = 25
> objConfig.Fields(cdoSMTPAuthenticate) = cdoAnonymous
> objConfig.Fields.Update
> set objMessage.Configuration = objConfig
>
> ' send the message and dispose of the object
> objMessage.Send()
> set objConfig = Nothing
> set objMessage = Nothing
> Server.Transfer ("request_thank_you.asp")
> 'else visitor is going to view the application page
> Server.Transfer ("index.htm")
> end if
> %>
> <%
> Recordset1.Close()
> Set Recordset1 = Nothing
> %>
>
Paul Whitham TMM Guest
-
innovationlab #3
Re: Can't stay logged in after submitting form
Just got around to trying that and it was the ticket.
God Bless you! I always get a 'fix' here!
innovationlab Guest



Reply With Quote

