How can I do this in CGI:
Here's what I wanna know:
- I have a file named "file.txt"
- In this file I have many words, seperated by '%%'
(%%wrod1%%word2%%word3 etc ...)
- Now somebody wants to add a word. What code should I put to make the script first seperate those words, then check if the word somebody is trying to submit is already listed. If YES it should write it in "error.txt" if NOT add it to the list.
I tried something with 'foreach' function, but can't seem to get it working.
Thanks in advance!
Here's what I wanna know:
- I have a file named "file.txt"
- In this file I have many words, seperated by '%%'
(%%wrod1%%word2%%word3 etc ...)
- Now somebody wants to add a word. What code should I put to make the script first seperate those words, then check if the word somebody is trying to submit is already listed. If YES it should write it in "error.txt" if NOT add it to the list.
I tried something with 'foreach' function, but can't seem to get it working.
Thanks in advance!