• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

Deleting selected email address from a txt file?

I have a sign up form that writes the users email address to a txt file and I would like to include an admin interface so that I can pick and choose email addresses that should or need to be removed from the txt file.
0
rgoniea
Asked:
rgoniea
1 Solution
 
rgonieaAuthor Commented:
Edited text of question
0
 
b2piCommented:
Is there a question here?
0
 
rgonieaAuthor Commented:
Yes it is right there, I want to add an admin section to my script to remove old or unwanted email addresses from the text file that stores the email addresses. How is this accomplished??
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
martinagCommented:
Well, I might give you some hints.

* First, you've got to have a password... Use encrypt.
  Either it will be entered once and then the admin-page is shown OR it is to be entered at the admin-page when a change is made.

* Listing of addresses.
  You can add them to a <SELECT> tag in the admin-page on the fly OR every time an address is added/changed/deleted.

* Delete addresses
  The selected address is removed from emails.txt or whatever file you are using.
  $file =~ s/$remove\n//;

Such script(s) shouldn't be too difficult.

Martin
0
 
stormeriderCommented:
Or also do something like this:

foreach $email (@arrayofemails) {
   print "<INPUT TYPE=CHECKBOX VALUE="$email">$email<BR>\n";
}

And then in the CGI that would remove them, you take the ones that are passed to the CGI because they are checked and s///g them. If you have an email address I can also mail you a way to do it via TEXTAREA tags if it isn't a 30K+ file (Browser limitations in displaying TEXTAREAS).
0
 
rgonieaAuthor Commented:
Stormrider, I am very new to writing Perl programs, could you explain with further code. What would be the process for opening the txt file and listing the email addresses and then deleting the ones I wanted too?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now