I developed a code to write to a file 4 values in the form:
value1 (name), value2 (date), value3 (time), value4 (email)
The file is a basic txt file located in paths/file.txt. It contains many lines though and I need a code that will:
1) loop the number of lines the text file is
2) retrieve the values(1-4) of the first line in which user input is equal to value4 of that line
3) i want to redirect the user to a page, depending on the values, based on an 'if' condition
The text file looks like:
John, 23 December 2003, 12:23, [email]firstname.lastname@example.org[/email]
Matt, 24 December 2003, 1:53, [email]email@example.com[/email]
Mark, 25 December 2003, 8:25, [email]firstname.lastname@example.org[/email]
Jen, 26 December 2003, 21:14, [email]email@example.com[/email]
The code on the page has a text box and asks for email address. It then will check the address of each line until it finds a matching one. Then, depending on all four values of the first matching line, the user will be redirected to a specified page, for example: 'their name.htm'. If the emails don't match, it will go to '/newemail.htm'
I think it is possible, but I am not quite sure where to start!