need help on creating a login page using asp

 
Post new topic   Reply to topic    Aprelium Forum Index -> ASP.NET
View previous topic :: View next topic  
Author Message
obener
-


Joined: 11 Jan 2008
Posts: 10

PostPosted: Mon Jan 14, 2008 1:28 pm    Post subject: need help on creating a login page using asp Reply with quote

hi all,

i want to create a login page on the website i am creating. the thing is that i found out that i need to use asp to do such a thing. Some websites i went through used dreamweaver and the others used frontpage. I wanted to know which one is easier to learn and design. Also can someone help me doing the the login page since im new to asp or show me a tutorial where i can learn on how to do it.

thanks all for looking
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Jan 14, 2008 5:43 pm    Post subject: Re: need help on creating a login page using asp Reply with quote

obener,

You can create a login system with any scripting language. What language do you know the better?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
obener
-


Joined: 11 Jan 2008
Posts: 10

PostPosted: Mon Jan 14, 2008 7:02 pm    Post subject: Re: need help on creating a login page using asp Reply with quote

aprelium wrote:
obener,

You can create a login system with any scripting language. What language do you know the better?


the truth, im new to all of them and would want to learn one maybe more later in time but would want to start with one of them for now. i know about microsoft access where i can create databases and do relations between them, im saying this because i know that you would need a database to keep the usernames and passwords and link it to them.
Back to top View user's profile Send private message
Tom Chapman
-


Joined: 09 Jul 2005
Posts: 933
Location: Australia

PostPosted: Tue Jan 15, 2008 8:46 pm    Post subject: Re: need help on creating a login page using asp Reply with quote

obener wrote:
aprelium wrote:
obener,

You can create a login system with any scripting language. What language do you know the better?


the truth, im new to all of them and would want to learn one maybe more later in time but would want to start with one of them for now. i know about microsoft access where i can create databases and do relations between them, im saying this because i know that you would need a database to keep the usernames and passwords and link it to them.


PHP is always a good starting point. A database is only really necessary when you want more than one account to be able to login and see as though you're new to it all, perhaps start with the basics first?

A small example of a php script that could be used with an appropriate HTML form could be;

Code:
<?php

$my_user = "obener"; // This is a variable. It's holding your username!
$my_pass = "098f6bcd4621d373cade4e832627b4f6"; // the password is actually "test" but it has been encrypted using MD5 for better security! to have a go at encrypting, visit http://www.sunsean.com/md5.html

$user = $_POST['user'];

if ($user = $my_user) {

   $pass = $_POST['pass']

   if (md5($pass) = $my_pass) {

      echo = "Correct username AND password! =P";

   }
   
   else {
   
      echo = "Correct username but you had better check your password... =(";
      
   }
   
}

else {

   echo = "Forget the password, get the username right first!";
   
}

?>
Back to top View user's profile Send private message Visit poster's website MSN Messenger
rrinc
-


Joined: 24 Feb 2006
Posts: 725
Location: Arkansas, USA

PostPosted: Tue Jan 15, 2008 10:55 pm    Post subject: Reply with quote

Its always a good idea to return a generic error message saying that the login failed and not whether the username or password was correct/wrong. If someone tries to beat the system you're helping them when providing specific information.
_________________
-Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados.
Back to top View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Tom Chapman
-


Joined: 09 Jul 2005
Posts: 933
Location: Australia

PostPosted: Wed Jan 16, 2008 4:27 am    Post subject: Reply with quote

rrinc wrote:
Its always a good idea to return a generic error message saying that the login failed and not whether the username or password was correct/wrong. If someone tries to beat the system you're helping them when providing specific information.


Maybe if you're the CIA lol...
Back to top View user's profile Send private message Visit poster's website MSN Messenger
obener
-


Joined: 11 Jan 2008
Posts: 10

PostPosted: Fri Jan 18, 2008 1:13 am    Post subject: Re: need help on creating a login page using asp Reply with quote

Tom Chapman wrote:
obener wrote:
aprelium wrote:
obener,

You can create a login system with any scripting language. What language do you know the better?


the truth, im new to all of them and would want to learn one maybe more later in time but would want to start with one of them for now. i know about microsoft access where i can create databases and do relations between them, im saying this because i know that you would need a database to keep the usernames and passwords and link it to them.


PHP is always a good starting point. A database is only really necessary when you want more than one account to be able to login and see as though you're new to it all, perhaps start with the basics first?

A small example of a php script that could be used with an appropriate HTML form could be;

Code:
<?php

$my_user = "obener"; // This is a variable. It's holding your username!
$my_pass = "098f6bcd4621d373cade4e832627b4f6"; // the password is actually "test" but it has been encrypted using MD5 for better security! to have a go at encrypting, visit http://www.sunsean.com/md5.html

$user = $_POST['user'];

if ($user = $my_user) {

   $pass = $_POST['pass']

   if (md5($pass) = $my_pass) {

      echo = "Correct username AND password! =P";

   }
   
   else {
   
      echo = "Correct username but you had better check your password... =(";
      
   }
   
}

else {

   echo = "Forget the password, get the username right first!";
   
}

?>


as the basics i understand that. its like c/c++ coding. if then else statement but i want a database since i will be having more than one user. i would be having about 30 users.
Back to top View user's profile Send private message
Tom Chapman
-


Joined: 09 Jul 2005
Posts: 933
Location: Australia

PostPosted: Fri Jan 18, 2008 1:42 am    Post subject: Re: need help on creating a login page using asp Reply with quote

obener wrote:

...

as the basics i understand that. its like c/c++ coding. if then else statement but i want a database since i will be having more than one user. i would be having about 30 users.


Well in that case, you've left me no choice! You've added me on messenger, time to learn SQL-PHP the Tom way!
Back to top View user's profile Send private message Visit poster's website MSN Messenger
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Jan 18, 2008 3:01 am    Post subject: Re: need help on creating a login page using asp Reply with quote

Tom Chapman wrote:
obener wrote:

...

as the basics i understand that. its like c/c++ coding. if then else statement but i want a database since i will be having more than one user. i would be having about 30 users.


Well in that case, you've left me no choice! You've added me on messenger, time to learn SQL-PHP the Tom way!


I don't mean to be rude or anything, but your code is wrong. I found two things wrong:

1. You're assigning a value instead of comparing it.
"($user = $my_user)" should be "($user == $my_user)", and
"(md5($pass) = $my_pass)" should be "(md5($pass) == $my_pass)"

2. You're using an equal sign when outputting the string to the browser.
echo = "Correct username AND password! =P" should be echo "Correct username AND password! =P"

Here's the fixed code. I'm hoping you did that by mistake. ;-)
Code:
<?php

$my_user = "obener"; // This is a variable. It's holding your username!
$my_pass = "098f6bcd4621d373cade4e832627b4f6"; // the password is actually "test" but it has been encrypted using MD5 for better security! to have a go at encrypting, visit http://www.sunsean.com/md5.html

$user = $_POST['user'];

if ($user == $my_user) {

   $pass = $_POST['pass'];

   if (md5($pass) == $my_pass) {

      echo "Correct username AND password! =P";

   }
   
   else {
   
      echo "Correct username but you had better check your password... =(";
     
   }
   
}

else {

   echo "Forget the password, get the username right first!";
   
}

?>


I recommend to read Larry Ullman's books on PHP, because he taught me so many new things (even MySQL!). You will learn so much from this guy. It's unbelievable! http://www.dmcinsights.com
Back to top View user's profile Send private message Visit poster's website
Tom Chapman
-


Joined: 09 Jul 2005
Posts: 933
Location: Australia

PostPosted: Fri Jan 18, 2008 6:31 am    Post subject: Reply with quote

1. WHY DO I ALWAYS re-set variables instead of comparing them in if statements. I normally find my code doesn't work so I hack away at nothing until 30 minutes later, I find i missed an equals sign. *sigh*

2. It is beyond me why I placed it there.

3. Lol.

4. It was 5 in the morning... XD
Back to top View user's profile Send private message Visit poster's website MSN Messenger
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Jan 18, 2008 7:26 am    Post subject: Reply with quote

The best way to learn is through trial and error. I've made mistakes like that before too, and I think we all have. ;-)
Back to top View user's profile Send private message Visit poster's website
obener
-


Joined: 11 Jan 2008
Posts: 10

PostPosted: Fri Jan 18, 2008 12:40 pm    Post subject: Re: need help on creating a login page using asp Reply with quote

TRUSTAbyss wrote:
I recommend to read Larry Ullman's books on PHP, because he taught me so many new things (even MySQL!). You will learn so much from this guy. It's unbelievable! http://www.dmcinsights.com


I just got the book (PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Ed.)) today after your recommondation. Im going to have a read through it and see how it is.
Back to top View user's profile Send private message
obener
-


Joined: 11 Jan 2008
Posts: 10

PostPosted: Fri Jan 18, 2008 12:41 pm    Post subject: Re: need help on creating a login page using asp Reply with quote

Tom Chapman wrote:


Well in that case, you've left me no choice! You've added me on messenger, time to learn SQL-PHP the Tom way!


I shall do.
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Jan 18, 2008 3:31 pm    Post subject: Re: need help on creating a login page using asp Reply with quote

obener wrote:
TRUSTAbyss wrote:
I recommend to read Larry Ullman's books on PHP, because he taught me so many new things (even MySQL!). You will learn so much from this guy. It's unbelievable! http://www.dmcinsights.com


I just got the book (PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Ed.)) today after your recommondation. Im going to have a read through it and see how it is.


That's great! I hope you learn a lot from it. Larry, in my opinion is the best programming teacher, because he teaches you through a project-based-approach with full code examples (not the little pieces of code you see in other books). The code is in bold print to show you what he changed, and the side of the page gives you detailed information about the code.

By the way, he has a forum were he can help you with your code (if you need any help). ;-)

Enjoy!
Back to top View user's profile Send private message Visit poster's website
dilipv
-


Joined: 04 Feb 2008
Posts: 6

PostPosted: Mon Feb 04, 2008 9:02 am    Post subject: creating Login Page Reply with quote

hi there,

This is Jitesh, i saw your quote. so you need to create login page. if you are lookin for simple than javascript is also advisable. but for your reference just go through the following links.

http://www.aspnetcenter.com/cliktoprogram/asp/login.asp

Hope that the above link will defiantly sole your query.

Thank you
Dilip
_________________
Sharepoint Consulting
Back to top View user's profile Send private message
AdvertisingEnterprises
-


Joined: 07 Jan 2009
Posts: 1
Location: USA

PostPosted: Wed Jan 07, 2009 7:49 am    Post subject: Reply with quote

Hello Everyone,

Like Obener, I too am trying to create a login and password field so that viewers of a website have to log in to see content. I want them to be able to self register and be able to click a link if they forget their password. If possible the registration would send an activation link to their email. Ideally this script or application would also be able to manage their newsletter subscriptions and provide statistics on who logs in and what content they view. Can anyone suggest how to go about doing this. I'm not experienced with PHP, CGI, MySQL or other databases. I have worked very little with access. I know HTML and design using Expression Web (the newest version of Microsoft Front Page). I look forward to the suggestions.

Tim
Back to top View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> ASP.NET All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group