473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How do i Validate code ?

Hi all newbie to programming,

I have an assignment to do using the client/server scenario. i have to log on using a user id and password ( both integers), then i have to check that this integers are correct by checking them against a file called CustomerAccounts, if they are correct i am allowed in and if not then an error message is displayed.
Now i can kind of figure how to get the data across and store it but i don't know how to check this with the file as it has to be an exact match and not just within a range.

Obviously as i have stated this is an assignment and i am not looking for someone to do the code for me but a couple of hints on how it could be achieved would be greatly appreciated.

Thank you.
Mar 19 '07 #1
2 1391
chella
51
Hi all newbie to programming,

I have an assignment to do using the client/server scenario. i have to log on using a user id and password ( both integers), then i have to check that this integers are correct by checking them against a file called CustomerAccounts, if they are correct i am allowed in and if not then an error message is displayed.
Now i can kind of figure how to get the data across and store it but i don't know how to check this with the file as it has to be an exact match and not just within a range.

Obviously as i have stated this is an assignment and i am not looking for someone to do the code for me but a couple of hints on how it could be achieved would be greatly appreciated.

Thank you.

Hi,
I have an idea and i don't know how far it'll work.

Have the CustomerAccounts file in the format,
username<colon>password <There was a smily being displayed - I have removed it. MODERATOR>
(delimited by colon)

-->In a loop try to read the file line by line.
-->Use strtok function and split the username and password and store them in a separate variables.
-->Then compare those with the scanned input. If any one fails(username or password does not match) give a error message....
-->Use flag variables to set it if matched.

Hope it'll give u some idea...

Regards,
Chella
Mar 19 '07 #2
Hi Chella,

Well yeah that kind of makes sense and i can see where your coming from, will give that a go cheers.

Fatboy
Mar 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: aevans1108 | last post by:
Greetings All If this is the wrong place to post this question, please give me a push in the right direction. Thanks. I know there has to be a simpler way to do this, but this is as simple a...
3
by: Claire | last post by:
I have a large record with many enumerated fields. The record is stored in a file and the fields have to be extracted. I validate the data as it's read, but there's so many tests similar to the...
6
by: Jonny | last post by:
Hi, I'm trying to validate my xml against a xsd but I can't get it to work. Originally, I wanted to validate an xml string but since I didn't get that to work I tried to validate an xml file...
26
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any...
4
by: Brybot | last post by:
I have a form that i've split up into multiple asp:panels, each panel has a number of validators which work correctly. At on the last panel, i want to commit the data collected to a database. I...
1
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
24
by: Mike Hofer | last post by:
Please forgive the cross-post to multiple forums. I did it intentionally, but I *think* it was appropriate given the nature of my question. I'm working on an open source code library to help...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.