Match code in link with code with one in file and extract li

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Peuplarchie
Forum Contributor
Posts: 148
Joined: Sat Feb 04, 2006 10:49 pm

Match code in link with code with one in file and extract li

Post by Peuplarchie »

Good day you all,
I work on a email confirmation system, I'm stuck on the part of matching the code in the confirmation link with the one in the file so I can find which line to move from the pending file to the confirmed file.

the lines in the file looks like that :

name, email, code
name, email, code

and the link look like :
http://mysite.com/confirmed.php?code=123456

How can I look for the line in the file that match the code in the link

Thanks!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Match code in link with code with one in file and extract li

Post by requinix »

It'd be easier with a database...

Open up the file, pretend it's CSV, and look for the code.
Meanwhile open up another file and dump each line from the other file into it - except for the one with the matching code. Then overwrite the original file with the temporary file.
Post Reply