ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 4th, 2012, 10:59 AM
aspnewbie aspnewbie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 2 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 52 sec
Reputation Power: 0
Retrieving cookies

Hello, im new to programming. Im making a login program that will go check ms access and then direct them to specific pages. Now my problem is to display the contents of the int213userid cookie in the Employee ID text box the first time the page is loaded and If they fail to log in for any reason, keep the value of the Employee ID text box in the text box for their next attempt.

coding =
Code:
Dim empid, password, errormsg, checker, sameid  

sameid = request.Cookies("int213userid") 
checker = 0  	

Do While Not Objrs.EOF  
If lcase(Request("empidfield")) = lcase(Objrs("empid")) AND Request("emppwfield") = Objrs("Password") Then  		

Session ("UserloggedIn") = "empidfield" 		 		
if Objrs("admin") = true then 			
if request("remember") = true then 			
'put cookie into int213userid 		

response.cookies("int213userid")=request("empidfield") 

response.cookies("int213userid").Expires = date + 30 			
Response.Cookies("int213userid") = sameid 			
'Call Response.Redirect("menu.asp") 
		else  			
'Call Response.Redirect("menu.asp")  			
end if 			 		
End If 		 		
if Objrs("admin") = false then  	
		
if request("remember") = true then 			

response.cookies("int213userid")=request("empidfield") 

response.cookies("int213userid").Expires = date +
30 			
Response.Cookies("int213userid") = sameid 			
'Call Response.Redirect("Payroll-entry.asp") 			

else  		
	
'Call Response.Redirect("Payroll-entry.asp") 			
end if 		
end if 		 
else  		
Session ("UserloggedIn") = "" 		
errormsg= "error" 		
checker = 1  
End If  
Objrs.MoveNext loop 	
Objrs.close 	
set Objrs = nothing 	
Objconn.close 	
set Objconn = nothing


HTML =
Code:
<form method="post" name="login" action="" >   
<p align="center">Employee ID:&nbsp;&nbsp;&nbsp;    
<input name="empidfield" type="text" size="20" value="<%=sameid%>"/> 
</p>    
<p align="center">Password:  
<input name="emppwfield" type="text" size="20" /> 
</p>   
<p align="center"><input checked="checked" name="remember" value="checkit" type="checkbox" />Remember Employee ID<br />   </p>   
<p align="center"> <input name="button" id="button" value="Login" type="submit" /> </p>   
<p align="center"><font color="red">


i am trying different stuff but none of them are working. Please Help! Asking for help was my last resort before i pull my hair. Thank You!

Reply With Quote
  #2  
Old April 4th, 2012, 12:38 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,234 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 14 h 20 m 49 sec
Reputation Power: 4445
What exactly doesn't work? What exact code are you working with? What have you done to debug your problem, do you get any error messages?
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
  #3  
Old April 4th, 2012, 03:07 PM
aspnewbie aspnewbie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 2 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 52 sec
Reputation Power: 0
At the moment, there are no errors. whats not working is my variable 'sameid' which gets the information from the cookie int123userid and should leave the name in the text box.

sameid = request.Cookies("int213userid")

<input name="empidfield" type="text" size="20" value="<%=sameid%>"/>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Retrieving cookies

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap