Author Topic: Website usernam password  (Read 2648 times)

0 Members and 1 Guest are viewing this topic.

Offline ThePyroTyper

  • NULL
  • Posts: 4
  • Cookies: 0
    • View Profile
Website usernam password
« on: July 13, 2011, 04:19:36 am »
Hello, I am trying to make a basic webpage with a username password entry. when you put in the right username and password it sends you to the next page that says correct. the username and passwords that will work will be held on a different file. can anyone give me some tips on this type of website making. i no it will use php but i need some keywords/types i need to use.
Hacking isn't illegal unless you abuse it ;)

Offline FuyuKitsune

  • Knight
  • **
  • Posts: 292
  • Cookies: 21
    • View Profile
Re: Website usernam password
« Reply #1 on: July 13, 2011, 04:39:36 am »
A few questions first: Do you know HTML? How much PHP do you know? Do you know the difference between post and get?

Just for starters:
-Username and password should be sent as post. The forms use the attribute method='post' to specify
-In PHP use $_POST["html_object_name"] to get these values so it'll look something like
Code: [Select]
$username = $_POST["username"];where "username" is the attributed name of the input box.

When you get the basic sending down:
-use hashing. Hash the password, then when a user logs in you hash the password they send you and compare it to the saved hash
-use databases instead of plain files. Learning databases is another project in itself but it's required for most web programming. It'll keep data well-organized.
-filter the input from XSS and SQL injection. This isn't required now but it's always good practice

Offline ThePyroTyper

  • NULL
  • Posts: 4
  • Cookies: 0
    • View Profile
Re: Website usernam password
« Reply #2 on: July 13, 2011, 05:08:32 am »
i no basic html and php and so your saying basicallly build i mini database ?
Hacking isn't illegal unless you abuse it ;)

Offline Stackprotector

  • Administrator
  • Titan
  • *
  • Posts: 2515
  • Cookies: 205
    • View Profile
Re: Website usernam password
« Reply #3 on: July 13, 2011, 11:32:10 am »
Possible to connect to an db, or you can hardcode a password like :   if $pinput == "monkey114253" {  session_start()    YOUR LOGGED IN etc.etc

Or you can get it from the database,  like   SELECT password FROM users WHERE 'username' = 'monkey'    and then see if the password equals the password entered
~Factionwars

Offline FuyuKitsune

  • Knight
  • **
  • Posts: 292
  • Cookies: 21
    • View Profile
Re: Website usernam password
« Reply #4 on: July 13, 2011, 04:27:30 pm »
i no basic html and php and so your saying basicallly build i mini database ?
Yes. Factionwars described above how the SQL command would go.

Offline ThePyroTyper

  • NULL
  • Posts: 4
  • Cookies: 0
    • View Profile
Re: Website usernam password
« Reply #5 on: July 13, 2011, 07:03:39 pm »
oh ok thank you and does anyone know any good Ruby Tutorials?
Hacking isn't illegal unless you abuse it ;)

Offline xzid

  • Knight
  • **
  • Posts: 329
  • Cookies: 41
    • View Profile
Re: Website usernam password
« Reply #6 on: July 23, 2011, 03:23:12 am »
please dont code ruby, who gave you that idea? Learn something more common as a first scripting language: python.