EvilZone
Programming and Scripting => Web Oriented Coding => : ThePyroTyper 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.
-
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
$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
-
i no basic html and php and so your saying basicallly build i mini database ?
-
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
-
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.
-
oh ok thank you and does anyone know any good Ruby Tutorials?
-
please dont code ruby, who gave you that idea? Learn something more common as a first scripting language: python.