Jump to content

Displaying one line of a text database and then deleteing it


bencohen

Recommended Posts

If I have a list of say 1000 voucher codes, one on each line of a text file, how do I issue one to a user and then delete that code from the list so that it is never given to more than 1 person?

 

Ideally I want to email it to them when they register to use our website. I did have some code that did this years ago but have lost it!

Hi bencohen,

 

I've used this custom function a few times in the past which may help.

 

You'd have to use PHP's count() function to count the lines in the text file and then you can specifiy which line you want to remove from the text file.

 

Hope this helps.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.