Welcome to Server Circle. It's a friendly site and all levels of experience are welcome. Be aware that we use cookies for your login.
Server Circle - Ask questions about Servers and get answers from experts.
Beta (0.58 sec)
REWARD: PHP code to add and remove name from a text file

I'd like to give users the chance to add and remove their names using a sign-me-up HTML form.

So they could "Thomas" to a text file with an HTML input box and then also remove themselves by choosing "remove" with a simple sign-me-up web form.

A bit like subscribing and unsubscribing from a mail list but the removal should search for the exact match in the text file (in upper or lower case) for the name "Thomas" and then say "you're removed" or "you're not on the list".

Is this possible ? A whopping 200 points to the first decent working PHP script (plus 50 points for the best answer).

Thanks very much.
Asked by:
Bogofilter
1565 points
 Report Abuse
 Share Page - Category: Programming - Tags: REWARD: PHP code to add and remove name from a text file
 Enter your response
Please use Pastie.org to paste lengthy code or to fix formatting issues with code
  • Responses in reverse (2)

Best Answer

Have not written / read text files in ages, SQL is so much better :) but here you go, hope this helps! You will need to make sure the webserver has access to read/write to names.inc :)

Code breaks page so posted it over at my Blog http://goo.gl/E8GBv

Also posted to pastie http://pastie.org/2242460 but the embed script wont work :(


Response by:
apjone
1478 points
Thanks for your help ! 200 points plus best answer to you !

Response by:
Bogofilter
1565 points


  • Related Questions
About Us : Contact Us : Etiquette : Terms : CDN Failover : ShorterURL : CDN Fallback : © 2014 Server Circle