Solved

Deleting selected email address from a txt file?

Posted on 1998-09-14
6
152 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

17 Experts available now in Live!

Get 1:1 Help Now