Reply
Dreamweaver Form - request variable
Old 04-07-2004, 02:03 AM Dreamweaver Form - request variable
Junior Talker

Posts: 1
Is there a way to use 1 form on 1 page (example: Log In Username & Password) to authenticate the user log in from a database and *ALSO* pass the username variable to the destination page? I need to password protect a site, which I have done using an Access Database and the authenticate user-Log In User function in dreamweaver. I would also like to pass the username variable to the destination page (for example after logged in: Welcome "Username"). The form "post" action is populated with the authenticate user code....is there a way to also include the destination url in the "post" action code to be able to pass the variable? Or is there any way to complete this task?
Looking forward to anyone's suggestions and help. Thanks!
hilarlee is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 04-08-2004, 12:43 AM Possible Methods
D.Viddy's Avatar
Average Talker

Posts: 24
Location: Soldotna, Alaska
If you are familar with ASP you could make two session variables. After the login is verified with the database you make these variables:

<%
'Get the username from the text box named txtUsername (uses post method)
Form_Username = Request.Form("txtUsername")

'Store the username in a session variable
Session("username") = Form_Username
'Store the status of their login in a session variable
Session("LoggedIn") = True
%>

Then on the "Welcome Member Page" you would put this code to first check if the user is actually logged in.

<%
'Check if the user has already logged in
If Session("LoggedIn") = False Then
'If not then redirect them to a login error page
Response.Redirect "loginerror.htm"
End If
%>

If the processing of the page gets passed that last block of code. Then insert this code where you want to print the username. So something like this:

Welcome <%=Session("username")%>, Thank you for logging in.

<%=Session("username")%>
This part will display the username inside of the session variable to the browser.

Do all of this of course if you are familar with ASP. If you aren't familar with ASP. You can try this:

On your verification page, after the user is verified. Store the username in a cookie on the clients machine that contains their username. Set it to expire immediatly. On the page that you want to print their username back to them. Use client-side javascript to read the contents of the cookie and return their name to them. There is a better way of doing this that involves using the query string. But I only know ASP and PHP so I don't know how you would access it on the response page.

I hope some of this helped you. Good luck with your quest.
__________________
-Dylan Vester

Last edited by D.Viddy : 04-08-2004 at 12:48 AM.
D.Viddy is offline
Reply With Quote
View Public Profile Visit D.Viddy's homepage!
 
Old 04-09-2004, 05:55 AM
Junior Talker

Posts: 1
This is very easy to set up in Dreamweaver. Asuming you have already set up your Log In User behaviour, create a new Session Variable from the Bindings menu. Where it asks for a name, type MM_Username.

You can now create a recordset on your following page to retrieve a record that matches the login name.

Create a new recordset, select your connection and table, and set up this filter:
FILTER: <field which holds usernames> = SESSION VARIABLE MM_Username

You can now insert the fields from the recordset on you your page.

Hope this helps

Tom
tbreeze is offline
Reply With Quote
View Public Profile
 
Old 11-25-2004, 01:13 PM
Junior Talker

Posts: 1
I want know how do in Dreamweaver and I have done step by step that D.Viddy suggest but in the "Welcome Member Page" I persevere don't read username. Any suggest ?
ghibli is offline
Reply With Quote
View Public Profile
 
Old 12-23-2004, 03:08 PM Forms Via Email
Junior Talker

Posts: 1
Hi, i have careated a subscription form with Dreamweaver 4 and have successfully retrieved the data with the formmail scripts!
But i have some problems, when i retrieved the data via email:

1)There is NO sender's name in the email, the space is blank
2)There is NO email listed from the sender so i can't reply

the scripts i'm using now is:

<form action="http://www.lga.net.sg/cgi-bin/FormMail.pl" method="post" name="Send Form" enctype="x-www-form-encoded">

<input type="hidden" name="recipient" value="subscribe@tienyudi.com">
<input type="hidden" name="subject" value="Mailing List Subscription">
<input type="hidden" name="redirect" value="http://www.tienyudi.com/sumitform.htm">


What else do I have to list in the input inorder to have the
1)name of the sender and
2)the sender's email address in the email to reply

Would really appreciate your help!

Thanks!
depth09 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Dreamweaver Form - request variable
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12547 seconds with 12 queries