Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
Setting cookie contents....?
Old 08-27-2006, 12:59 AM Setting cookie contents....?
Junior Talker

Posts: 1
Trades: 0
Hey,

I was wondering if anyone could help me out with the following problem. I have created a user authentication system using dreamweaver. It all work fine except I want to make a few changes.

Here is the code I want to change;

Code:
1        <Script runat="server">
2        Sub button_click(s as object, e as eventargs)
3              If ds_checkuserinfo.RecordCount = 1 Then
4                    Response.Cookies("ckusername").Value = Request.Form("txtusername")
5                    Response.Cookies("ckusername").Expires = DateTime.Now.AddDays(1)
6                    Response.Redirect("index.aspx")
7              End if
8        End Sub
9        </script>
How do I assign the fist cookie, 'ckusername' (line 4) to a value from a MSSQL database instead of a form variable?

EDIT: Im coding in asp.net

Thanks in advance
-Smitch

Last edited by Smitch; 08-27-2006 at 01:47 AM..
Smitch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-29-2006, 07:22 AM Re: Setting cookie contents....?
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
That depends on how your database is structured/your prefered method of connecting to the database/etc.

I'm going to assume Dreamweaver is generating this code here?
If so, try getting it to display the value from the DB on the page, then look at the code to see how it does that. You should then be able to tie the 2 bits of code together.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Reply     « Reply to Setting cookie contents....?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





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



Page generated in 0.31770 seconds with 12 queries