4 Replies - 1555 Views - Last Post: 16 June 2008 - 11:48 PM Rate Topic: -----

#1 richa singh   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 16-June 08

can anyone help me in writing the code of a simple login page

Post icon  Posted 16 June 2008 - 03:14 AM

can anyone help me in writing the code of a simple login page..

i had designed the page with two textboxes for username and password and one button for login.

please tell me the code for this page..
Is This A Good Question/Topic? 0
  • +

Replies To: can anyone help me in writing the code of a simple login page

#2 mensahero   User is offline

  • I Desire...
  • member icon

Reputation: 17
  • View blog
  • Posts: 680
  • Joined: 26-May 08

Re: can anyone help me in writing the code of a simple login page

Posted 16 June 2008 - 05:21 AM

[rules][/rules]


A simple conditional statement should work.

if username.text = "Mensahero" then
   if password.text = "Gwafu" then
		msgbox "Username and Password is Correct. "
   end if
end if




That won't work if you copy paste it. Believe me.
Was This Post Helpful? 0
  • +
  • -

#3 hickssr   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 15-June 08

Re: can anyone help me in writing the code of a simple login page

Posted 16 June 2008 - 11:12 AM

View Postmensahero, on 16 Jun, 2008 - 05:21 AM, said:

[rules][/rules]


A simple conditional statement should work.

if username.text = "Mensahero" then
   if password.text = "Gwafu" then
		msgbox "Username and Password is Correct. "
   end if
end if




That won't work if you copy paste it. Believe me.


What application is the login for. ASP.NET for instance has a built in login control that makes it easier to to code although some coding is necessary. The reply above will work but if you have multiple users the if statement can get long and if users are added or deleted often it can get crazy to hard code. I would reccomend creating a database to hold the login information and write the code to compare it to the login attempt.

However, you need to show the code you have tried so we can help guide you on your errors we cannot do it for you completely.
Was This Post Helpful? 0
  • +
  • -

#4 urabhisheks   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-June 08

Re: can anyone help me in writing the code of a simple login page

Posted 16 June 2008 - 11:21 PM

hi dere ....

to make a login window.....
first tell me ur requirements....
do u want to make login from database or for few users without database.......
for few users the code is rt below....

private sub command1_click()
   dim usrname,pswd as string
   usrname = text1.text
   pswd = text2.text

if  ((usrname = "a" and pswd = "b") or (usrname = "b" and pswd = "c")) then
   form2.show
end if

end sub



if u have any probs contact me @ {ADDRESS REMOVED}

** Edit ** :code:
Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: can anyone help me in writing the code of a simple login page

Posted 16 June 2008 - 11:48 PM

@urabhisheks: Please, we have a policy, stated in the Forum Rules that we don't write peoples code for them, and we also don't just give them the code they seek without showing some effort first.

Also, when it comes to questions being asked here, don't offer to help them in email, keep it here in the forum, someone might have the same questions someday and would benefit from his final solution :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1