Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 





Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Design Forum > Web Serving and Management
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read

Web Serving and Management how to web server support forum

Reply
 
Thread Tools
Old 03-16-2008, 10:45 PM   #1 (permalink)
On or offline which am I?
 
ags131's Avatar
 
Join Date: Oct 2007
Location: Alabama
Posts: 212
OS: Win XP Pro SP2, Kubuntu (LINUX), (95, 3.1, in VirtualPC)

My System

Post User Logins

I have created a user login system in asp i would like to share. Many people have been trying to do this and i hope this helps.
I have all the files in the zip.

The default.asp page is the page containing the form and the required hidden fields. make sure to change the value of the toPage hidden field to the url of the page you want to open after the user is logged in.

You will have to add users manually to the database. im not sure if the db.asp code will add a record correctly. As i fix the problems i will post the updated file.

One important step: put all the files in the SAME folder. Otherwise you will need to fix the links. Also make sure the server supports ADO and databases.

The code sets a session variable, "user", to the username if it is valid.
Hope it helps.
Attached Files
File Type: zip UserLoginWithDatabase.zip (10.8 KB, 17 views)
__________________
Adam

Join the TSF Team for the Folding@Home Project. Team number 85015.
ags131 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 03-19-2008, 02:26 PM   #2 (permalink)
On or offline which am I?
 
ags131's Avatar
 
Join Date: Oct 2007
Location: Alabama
Posts: 212
OS: Win XP Pro SP2, Kubuntu (LINUX), (95, 3.1, in VirtualPC)

My System

Re: User Logins

I have updated the files. It now supports adding users to the database and changing username and/or password from a asp page. I have all the required files in the zip. the account that is in the database is:
Username: admin
Password: Admin
I would recommend using the update area of the page you are redirected to after login to change it. You will have to make sure you have read/write permissions for the setup to work correctly. Here is the link to the file: UserLoginWithDatabase.zip

If you get a 404 error or the file doesnt download please wait approx. 5 minutes and try again. the server is on my home computer and is not very fast. If you want to see an example please go here. This is the directory where i am storing all the files required.
__________________
Adam

Join the TSF Team for the Folding@Home Project. Team number 85015.

Last edited by ags131 : 03-19-2008 at 02:32 PM.
ags131 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 03-21-2008, 10:33 PM   #3 (permalink)
On or offline which am I?
 
ags131's Avatar
 
Join Date: Oct 2007
Location: Alabama
Posts: 212
OS: Win XP Pro SP2, Kubuntu (LINUX), (95, 3.1, in VirtualPC)

My System

Re: User Logins

Here is a quick tutorial on how to use my asp pages:
first lets take a look at the form code:
PHP Code:
<form name="frm" method="post" action="login.asp">
<
input type="hidden" name="action" value="get" />
<
input type="hidden" name="table" value="users" />
<
input type="hidden" name="toPage" value="home.asp" />
Username: <input type="text" name="user" />
<
br />
Password: <input type="password" name="password" />
<
br />
<
input type="submit" value="Login" />
</
form
all the hidden fields are required.
The action field defines what to do to the database.
get - checks the username and password and logs the user in if valid
add - adds a user
update* - changes a users profile
delete** - removes a user

The table field defines what table in the user.mdb file to open
users - main user table (required to work) (only table in database)

The toPage field should contain the URL of the page to load when done. The URL must be relative to the asp pages.

And everyone can guess what the user & password fields are.
Any fields can be changed to hidden or text. if you need i am here to help please post comments and let me know what you think.

*two extra field required: user2 for new username & password2 for new password

**not sure if it works.
__________________
Adam

Join the TSF Team for the Folding@Home Project. Team number 85015.
ags131 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 03-22-2008, 08:46 AM   #4 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: Windows XP Service Pack 2


Re: User Logins

All of this looks amazing, but could you put the updated.zip file on like filefront or something so everyone will be able to download it easier?

-edit:
Wait, I have a question... I can see where you put in the URL and all that, but what do you do to make multiple pages blocked?

Last edited by Gohraw : 03-22-2008 at 08:51 AM.
Gohraw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 03-23-2008, 05:43 PM   #5 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: Windows XP Service Pack 2


Re: User Logins

i've tried multiple times trying to download it.. do you think you could host it on a website or email it to me or something?
Gohraw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 03-24-2008, 02:30 PM   #6 (permalink)
On or offline which am I?
 
ags131's Avatar
 
Join Date: Oct 2007
Location: Alabama
Posts: 212
OS: Win XP Pro SP2, Kubuntu (LINUX), (95, 3.1, in VirtualPC)

My System

Re: User Logins



Here is the file hosted on filefront.

@gothraw fo each page that needs protected insert this asp code:
Code:
<%
if session("user")="" then response.redirect("default.asp")
%>
Change response.redirect("default.asp") to point to the login page that you fix.
__________________
Adam

Join the TSF Team for the Folding@Home Project. Team number 85015.

Last edited by ags131 : 03-24-2008 at 02:31 PM.
ags131 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 03-31-2008, 08:33 PM   #7 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: Windows XP Service Pack 2


Re: User Logins

hey, sorry I took so long to respond, but I'm having trouble getting this thing working
Gohraw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 04-02-2008, 10:29 PM   #8 (permalink)
On or offline which am I?
 
ags131's Avatar
 
Join Date: Oct 2007
Location: Alabama
Posts: 212
OS: Win XP Pro SP2, Kubuntu (LINUX), (95, 3.1, in VirtualPC)

My System

Re: User Logins

Which part are you having problems with?
__________________
Adam

Join the TSF Team for the Folding@Home Project. Team number 85015.
ags131 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 04-04-2008, 04:55 PM   #9 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: Windows XP Service Pack 2


Re: User Logins

well, it just doesn't seem to want to work. i'm probably just putting the URL into the wrong spot
Gohraw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 04-06-2008, 11:55 PM   #10 (permalink)
On or offline which am I?
 
ags131's Avatar
 
Join Date: Oct 2007
Location: Alabama
Posts: 212
OS: Win XP Pro SP2, Kubuntu (LINUX), (95, 3.1, in VirtualPC)

My System

Re: User Logins

UPDATE: The live version is available here.
The zip file is hosted here:




@Gohraw
If it is just showing the source code then your server isnt set up for asp. If it is giving a databse read/write error then follow these instructions to fix the problem:

Goto IIS control panel: right click the folder the database is in: click properties.
IIS1.bmp
make sure scripting and read/write permissions are set.
IIS2.bmp
do the same for the database.
IIS3.bmp
IIS4.bmp

if you have the page with the form at the root of your server and the db processing page in a folder named data then have your form code point to it. to return to the same page after the login has been verified make sure you include .. in the toPage area.

Ex.
login from login.html in root (site.com/login.html)
sends data to login.asp (site.com/data/login.asp)
login.asp sends you to a successful.asp page in root (site.com/successful.asp)
(The toPage value would have to be set to ../successful.asp)

If this doesn't help you can give me your site URL or IP and ill look at the page source codes.
__________________
Adam

Join the TSF Team for the Folding@Home Project. Team number 85015.

Last edited by ags131 : 04-07-2008 at 12:06 AM.
ags131 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 04-07-2008, 11:58 PM   #11 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: Windows XP Service Pack 2


Re: User Logins

Unless I'm misunderstanding you, I need to create a new .asp file for each part of my website that I would like to hide from those who are not registered.


However, if I'm wrong and you're tired of trying to explain how to do this to me, then here is the deal: My website home page is http://www.chchcheckit.com. A page that I may or may not want to hide from those who are not registered to my website is something like "...com/extras.htm". Now, what exactly would I have to add/change amongst the asp files in order to accomplish this? This one example will most likely end all of my problems and hence I will no longer bug you
Gohraw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 04-08-2008, 12:12 AM   #12 (permalink)
On or offline which am I?
 
ags131's Avatar
 
Join Date: Oct 2007
Location: Alabama
Posts: 212
OS: Win XP Pro SP2, Kubuntu (LINUX), (95, 3.1, in VirtualPC)

My System

Re: User Logins

Instead of linking directly to the extras.htm page simply have it goto a asp page that checks the login info and continues if it is good.

You can copy this code into an empty asp page and use it to redirect. simply add a case X statement for each page. where X is the ID you want for that page.

Ex.
PHP Code:
<%
dim loginErr
dim loginSuc

loginErr
="loginError.htm"

select case request.querystring("PID")

case 
1
  loginSuc
="extras.htm"

end select

sub invalid
()
  
response.redirect(loginErr)
end sub

if session("user")="" then invalid()
response.redirect(loginSuc)
%> 
all you would need to do is pass the value PID to the asp page. in this setup it would be linked as: loginCheck.asp?PID=1 if the file was named loginCheck.asp

if for example, you wanted the users to use the page i built, and it is stored in the user directory then loginErr would need to contain the value "user/default.asp"

You can modify the pages to suit your needs. to create a login form you can copy the code from default.asp and modify the hidden values. unless you change the database the table and database values must always be the same.
__________________
Adam

Join the TSF Team for the Folding@Home Project. Team number 85015.

Last edited by ags131 : 04-08-2008 at 12:19 AM.
ags131 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 08-03-2008, 06:19 PM   #13 (permalink)
Registered User
 
Join Date: Aug 2008
Posts: 1
OS: Win XP Pro SP2


Send a message via AIM to fuericfu
Re: User Logins

Okay I am a complete noob at this so here's what I got.
I've downloaded the files. And I am completely lost. Okay first do I upload the folder containing all the files. and then What do I name it? Also I have no idea how to change the hidden values and also the toPage stuff.

I would really appreciate it if you could maybe help me do it

Thanks.

[P.S.] Also I would like to hide the ENTIRE website to those un-registered. Is that possible? If not, I can live with it.

Last edited by fuericfu : 08-03-2008 at 06:25 PM.
fuericfu is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 08-06-2008, 09:26 PM   #14 (permalink)
On or offline which am I?
 
ags131's Avatar
 
Join Date: Oct 2007
Location: Alabama
Posts: 212
OS: Win XP Pro SP2, Kubuntu (LINUX), (95, 3.1, in VirtualPC)

My System

Re: User Logins

First of all does your server support asp? are you using asp on the pages you want to protect? If your not sure what web server (Host, such as freewebs.com) do you use and what package?

The examples i'm using in this message have the downloaded files all in the login folder. but the folder also needs to have write access and the database needs write access.

Heres the code to insert into the top of your pages that you want the user to be a member of: (NOTE: Page must have .asp at the end of the filename.)
Code:
<%
if session("user")="" then response.redirect("login/default.asp")
%>
Or you can create a page that will check each page before it loads.

for example. If you wanted to link to a page named extras.htm you would add a Case statement in this code and link to loginCheck.asp?PID=extras to load the page. if it cant find a case statement in the code it will attempt to open the page specified by PID

(Ex if the link points to loginCheck.asp?PID=Links and it does not find a case statement for links then it will try to open links.htm)

PHP Code:
<%
dim loginErr
dim loginSuc
loginErr
="loginError.htm"

select case request.querystring("PID")

'case format:
'
'case someNumberOrText
'  
loginSuc="somepage.htm"

case 1
  loginSuc
="home.htm"

case "home"
  
loginSuc="home.htm"

end select

sub invalid
()
    
response.redirect(loginErr)
end sub

if session("user")="" then invalid()
if 
loginSuc="" then logonSuc=request.querystring("PID") & ".htm"
response.redirect(loginSuc)
%>  
  </
body>
</
html
if you use frontpage to manage/edit the website i might be able to help you some more. If you need more help you can ask here or email me at atj_boys@tombigbee.com or instant message me by my yahoo ID card_man93.

Hope i helped.
__________________
Adam

Join the TSF Team for the Folding@Home Project. Team number 85015.
ags131 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Reply


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



All times are GMT -7. The time now is 02:17 PM.



Copyright 2001 - 2008, Tech Support Forum

Search Engine Friendly URLs by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59