pulling data from .csv file
Posted: Wed Mar 11, 2009 8:28 am
Hi everyone.
I'm wondering if some kind person could point me in the right direction?
I've got a client who has an excel database with amongst other info, column titles for customer name and a password.
I need to be able to do a header redirect upon the client's customer entering their password into a form on the client's website. The website then emails my client to tell them that a certain user has gone to that link. Does that make sense?
E.g. end user comes to password request box. Types in unique password and assuming password is correct they are redirected to a certain page (off-site actually).
Now I'm thinking that my client needs to save their excel spreadsheet as a .csv to be remotely useful - but here's where I'm not sure of the best way to do things.
Would it be best if:
1. Just give them an FTP programme and tell them to upload the .csv file to a certain folder and give it a certain name so that it overwrites the older version and, when the end-user enters a pw on the site, use PHP to open the file, read it, check if the PW exists, if it does - re-direct them and finally email my client to say it's done it.
2. Have the client upload the .csv file to the website via an admin panel, which (and I'm a bit unsure of getting the info from the .csv to the update query) will then take the information and store it on a MySQL DB. Then when the end user gets the password form the site will just query the DB and if the password exists, re-direct them accordingly.
I guess in either case I'll probably be using a similar PHP action (fgetcsv ?) to open and read the .csv file but I'm a little unsure of which is the best approach and what's the best flow for the process.
Thanks!
I'm wondering if some kind person could point me in the right direction?
I've got a client who has an excel database with amongst other info, column titles for customer name and a password.
I need to be able to do a header redirect upon the client's customer entering their password into a form on the client's website. The website then emails my client to tell them that a certain user has gone to that link. Does that make sense?
E.g. end user comes to password request box. Types in unique password and assuming password is correct they are redirected to a certain page (off-site actually).
Now I'm thinking that my client needs to save their excel spreadsheet as a .csv to be remotely useful - but here's where I'm not sure of the best way to do things.
Would it be best if:
1. Just give them an FTP programme and tell them to upload the .csv file to a certain folder and give it a certain name so that it overwrites the older version and, when the end-user enters a pw on the site, use PHP to open the file, read it, check if the PW exists, if it does - re-direct them and finally email my client to say it's done it.
2. Have the client upload the .csv file to the website via an admin panel, which (and I'm a bit unsure of getting the info from the .csv to the update query) will then take the information and store it on a MySQL DB. Then when the end user gets the password form the site will just query the DB and if the password exists, re-direct them accordingly.
I guess in either case I'll probably be using a similar PHP action (fgetcsv ?) to open and read the .csv file but I'm a little unsure of which is the best approach and what's the best flow for the process.
Thanks!