Solved

Deleting selected email address from a txt file?

Posted on 1998-09-14
6
148 Views
Last Modified: 2010-03-05
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
Comment
Question by:rgoniea
6 Comments
 

Author Comment

by:rgoniea
ID: 1204847
Edited text of question
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1204848
Is there a question here?
0
 

Author Comment

by:rgoniea
ID: 1204849
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 4

Expert Comment

by:martinag
ID: 1204850
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
 
LVL 1

Accepted Solution

by:
stormerider earned 70 total points
ID: 1204851
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
 

Author Comment

by:rgoniea
ID: 1204852
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
perl script 4 94
Perl script to parse xml file 2 96
Perl Awk Need Help 3 94
Perl Application JSON Receiving Strange Java Error 3 65
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now