Quote:
Originally Posted by ElphieFabalaFae
While I test this out, there will be three fields to every user file - username, password, email - it that order, over and over, for three users (at the moment). I understand the principle of going to the right record, finding the info and then checking it, but it's actually transferring the principle into practice. I guess I will have to keep playing around and searching the net for some more help/information.
|
The principal is the same, no matter which language you choose.
You just need to learn the proper syntax for that language.
You already have the basics, you just need to put them together.
It is easier to understand if you give it an order.
Setup your variables first.
Perform your logic second.
And then output the results.
So once you get the data from the form, you store it in variables.
Let's say we use:
username
password
email
Then we open the text file and read in the first three lines,
that would represent the first record.
And store them in variables.
Let's say we use:
usernamef
passwordf
emailf
Then we check to see if username == usernamef and password == passwordf and email == emailf.
If all three checks come up true, then we store the variables from the text file into the output variables; usernameo = usernamef and passwordo = passwodf and emailo = emailf.
Otherwise you read in the next three lines from the file and run the checks again.
Then you check to see if usernameo and passwordo and emailo have values.
If they do, then output them to the screen.