Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





How To Delete Single Email Adres From Text File


I have a textfile:

bla@domain.com
blabla@domain2.com
haha@domain.com
la@domain3.com
zaza@domain4.com

How can I delete a single email from that text file ? E.g. I want to delete blabla@domain2.com so that the textfile will be:

bla@domain.com
haha@domain.com
la@domain3.com
zaza@domain4.com

How can this be done ??




View Complete Forum Thread with Replies

Related Forum Messages:
How To Echo A Single, Specific Line From A Text File
How do I echo a single, specific line from a text file?  Let's say, for example, the second line?

View Replies !
Delete First Line Of A Text File
how i can open a data.txt file and remove the first line and then save it.

View Replies !
Check ' In Text File And Delete
I have 6 document files and some file has ' each line in text about 1000 lines. I want to clear all ' each line and I save all files same folder, how should I do?

View Replies !
Delete First 9 Lines In Text File
how I can delete the first 9 lines in a text file?

View Replies !
How To Delete A Single Field?
I have a database with ten fields for image paths, [imgpath1] [imgpath2] etc. I would like to make a delete button to delete these individually if needed and just have no idea where to start - what is the typical method of deleting just ONE FIELD using a button?

View Replies !
Get All The Email Addresses From A Text File
I have a .txt file with a lot of text mixed with some email addresses. I
would like to get all the email addresses in a $mails[] variable. Does
anyone know how to do this in php.

View Replies !
How To Extract An Email-address From A Text File
Can somebody show me a quick code snippet to reliably extract an
email-address form a text file ?

View Replies !
Writes The Email Address To The Text File
I've got a PHP form processor running that sends the forms fields via email and then writes the email address of the sender to a text file on the server.

I've got it working perfectly except when it writes the email address to the text file, it puts them all on the same line. I need to get it to put each address on the next line down. This is probably a pretty simple thing to do but my eyes are bugging after trying for a while now.

Here is the code that writes to the text file:

////////////write to file///////////
$out = fopen("/home/myserver/leads.txt","a");

if (!$out) {
print("Could not append to file");
exit;
}

$T1 = $_POST[$reply_to_field];

fwrite($out,"$T1 ");

fclose($out);

View Replies !
Delete Entire Line In Text File If Anything In The Line Matches Search String
how would I code a php script that would open a text file, look for a string i specified, and if it finds that string, it will delete the entire line in the text file that contained that text. I'm new to php, so sorry if this is really obvious..

View Replies !
Trouble Extracting Email Address From Text File
I'm trying to put together a script that will read an email box set up for newsletter bounces and remove the bad addresses.

There's an old script I've worked with that looks for --- Permanant fatal errro ---, but not all the bounced emails have that line included (3 out of about 700 do).

I need to find the bad address, then delete that address out of the database. I've got the deleting out of database down, but am not sure how to find any email address & delete it.

View Replies !
Regular Expression Which Reads A Text File And Stores All The Email Addresses Found In TEXTFILE In A Variable.
I need a regular expression, which reads a text file and stores all the Email addresses found in TEXTFILE in a variable.

View Replies !
Combining Text From Multiple Webpages Into One Single Page
I want to write a PHP script that will in essence copy text from a number of webpages and paste it into just one single page - i.e combining all the text of the seperate pages into one big page.

The layout of each page is the same, so if it was possible to set markers between which the text would be copied (i.e from after the heading adverts to just before the links at the bottom of the page) that would be good. The pages URLS are in ascending order, e.g www.site.com/1/, www.site.com/2/, www.site.com/3/ and so on. So maybe a loop that will count up until the 'file not found' error occurs, indicating the end of that set of pages. Code:

View Replies !
Delete Email
i use this code to delete a specific email. PHP Code:

$do = $pop3->delete_mail ($delid);
        if ($do == false) {
                echo $pop3->error;
        }
        
        echo 'message deleted'

View Replies !
Display The Text That Single Quotes Get Replaced With Question Marks
not sure if any one has had this problem before. I have for example

insert (text) VALUES ("'.$_POST['text']. '"); - it seems when i display the text that single quotes get replaced with question marks does this have to do with collation or magic quotes or something entirely different?

View Replies !
Email Delete Function
Im looking for ideas on writing a function or finding one that would delete table content based on email being returned based on either unsubscribe or on email bouncing. I am just in the organization phase of writing this script.

View Replies !
Remove A Single Element Out Of That File Without Deleting The Whole File?
I'm using different files to store some arrays to make administration of a very small job-logger very easy. I currently read the file, remove the element to be deleted, delete the whole file, and write the file again without that element. Is there a way to remove a single element out of that file without deleting the whole file?

View Replies !
How To Delete Only Certain Text In A Mysql Row?
I have a table setup that has a column setup as friends and users can add friends to this column no problem.

What I would like to know is how to delete only certain parts of the text of the row/cell where their friends are stored.

The friends text is seperated by the following :

" , "

That is a space on either side and comma in the middle of the space.

I know how to explode the results and put into an array to display the reuslts, but is there a way to delete only one of the friends if the text is as follows.

 , thomas , frank , irene ,

I think you can get the idea.

Is it possible to do this or should I just update the whole cell without the array[$i] result being the friend?

View Replies !
Delete Text In Inputboxes
I fill out an inputbox and press submit, when I press back or even reload in firefox, the inputboxes continue to have the same values filled out previously.

View Replies !
Auto Delete Record/Send Email After X Hours
What I have is a MySQL database which stores records that each have a date stamp on them (2 of them - one for record created date and one for record last updated date), what I want to do is try and have it so that records that haven't been updated in say 72 hours are automatically removed from the database, or the record is updated to set a flag as being out of date, or an email is sent to alert a user of the out of date record etc.

I can easily write the script with the SQL query to check the records by the datestamp and perform the actions needed if the records are out of date, however that requires someone to physically visit that page to run the script and clean up the out dated records. What I want to try and do is have this happen automatically on its own without someone needing to actually visit the page to run the script.

A good example is on eBay how emails are sent to you to let you know when your auctions are about to expire, i wouldnt imagine that eBay would rely on people visiting their website to make those queries run on the database so there must be a way of doing some automated script executio or having a scheduled task run on the server to have a PHP script run each day at midnight or something? Anyone know how to do this?

View Replies !
Delete Function That Deletes A String Of Text
I am trying to fix my delete function that deletes a string of text that may or may not have single, double quotes, pound signs etc.

function delete_bm($user, $url)
{
// delete one text string from the database NOT a url as would be suggested
if (!($conn = db_connect()))
return false;

// delete the Item
if (!mysql_query( "delete from XMAS_WISH_LIST
where username='$user' and XMAS_ITEM='".mysql_escape_string($url)."'"))
return false;
return true;
}

When I run this on my web page, I don't get an error, it just does not delete the item that I am passing it, like the following: "test" (with quotes).

Any suggestions?

View Replies !
Updating A Single File
i want to update a single file some of the info i request is being display except for the picture and the second one is that it is not updating into the database i guess. i have to problem in one Code:

View Replies !
Download File And Delete File From Server With One Button Click
I want the user to be able to download a CSV file and delete the file from the server all with the click of a button.  Currently, in firefox, it will just display the CSV and not delete it. In IE, it will download the CSV and not delete it. Code:

View Replies !
Write To Text File - Output The Result To A Text File
What i would like is to output the result to a text file Code:

View Replies !
Reading A Single Line From A File
In asp I can read a text file line by line like this.

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("FileName.txt"), 1)
strLine1 = (f.ReadLine)
strLine2 = (f.ReadLine)
strLine3 = (f.ReadLine)
f.Close
Set f=Nothing
Set fs=Nothing
%>

I need to assign line 1 to one variable line 2 to a different variable and so on. Any help is greatly appreciated. Btw, I'm using php4.

View Replies !
How To Access A Single Line From A File
I want to select a single line from a file. How can I select a line from the file and save it in a variable.

View Replies !
Single Quotes And File Uploads
It appears that $_FILES['userfile']['name'] does not support single quotes. Whenever I try to upload a file with a single quote it will truncate everything before the quote in the name.

I've been doing some testing but it may actually be the file input type not liking the single quote. Code:

View Replies !
Single Braedcrumb File If There Is Value Without Element
I would like way to keep a single braedcrumb file if there is value without element. if there is value for element, it should be added code in braedcrumb file as following:

[PHP]$bc->elements[1]->subdirs=array("Mainproducts101.php","Mainproducts102.php");[/PHP].

View Replies !
Is There A Way To Assign Multiple Variables A Single Value On A Single Line?
$f1, $f2, $f3 = &#391;'
and
list($f1, $f2, $f3) = 1;

neither work... second obviously cuz its looking for an array on the right
side, correct?

Right now i have ot build a for loop to assign the values

View Replies !
Single PHP File - *.php = Process, *.phps = Source.
Hoping for some direction here (I have searched, without avail, for a
solution already).

I was toying with trying to find a way whereby I could have a single
PHP file, and then specify whether to either see the processed output
or the source code by using the extensions php and phps (respectively).

So, with one file called "theFile.php" on the server, going to
"www.server.com/theFile.php" would show the end result of the php
actions, whereas going to "www.server.com/theFile.phps" would show the
actual content of the file itself.

I thought this could be done by modifying the htaccess file as follows:

AddType application/x-httpd-php-source phps

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+).phps$ $1.php

However this does not work:
- if a *.php file exists, then accessing *.php or *.phps returns the
end result of the php actions.
- if a *.phps file exists, then accessing *.php returns a 404 error,
and *.phps shows the actual file contents.

Looking for any direction, references, or assistance.

View Replies !
Downloading Multiple Files In Single Zip File
I am developing the project management system.

Each Project:
1. Title, description ... , stored in mysql database
2. Upto ten files (initial description), (name in db, file in file
system)
3. Message board, stored in mysql database (1 file per message, message
in db, file in file system)

I need a link (Download Project) which will download all the project
related files, description, message board in the single zip file.

View Replies !
File Manipulation: Erasing A Single Line?
When a user logs into my website I append his name on a line in a .txt file. When the user closes his browser I make it so it logs him off. The problem I have is taking his name out of my file.

I go through the file with fgets and compare the username to the current line and can find where it is with that. Trouble is, I have no clue how to get rid of it.

I looked around and spent like an hour fooling around with ftruncate and have concluded that this is probably not what I'm looking for.

So my question is, how do I get rid of the line? Do I have to position the file pointer position thingy somewhere and just write an empty string?

View Replies !
Validation Problem - Upload A Single Image File
Im using the following to upload a single image file. The form works to limit the size of the file (If the file is over 500k it won't be uploaded).

However - my error handling doesn't seem to be working correctly. I've left out the code thats not associated with the image upload below for the most part. Code:

View Replies !
What Is The Best Way To Delete File ...?
I have script that allows a user to upload a txt file for processing, filtering, to save bandwidth,instead of user reuploading the file everytime he/she does a new process on the same file, i save the file to the server, and process from that file. What I want to be able to do is, when the user uploads a new file, or leaves the site, this temp file is automatically deleted (saves disk space).

View Replies !
Delete File();
I was wondering if php4 has a built in function that could delete a file. In my case I need my php to delete a picture. (jpg, gif) Does php4 have the ability to delete an exsiting file? Something like this?? delete_image("../images/somePic.jpg");

View Replies !
Delete A File
How do i delete a file from my server with php?

View Replies !
Delete File
How do I delete a file with PHP?

View Replies !
Delete File With Php
Im a little new in php, and just made a site where u can upload pictures, but how can i make it possible to delete pictures as well.

View Replies !
File Delete
I need to delete a compressed backup file after it has been sucessfully uploaded to a ftp server, the upload works fine using CRON and a php page. I have tried to delete the file using:

<?
$oldfile = "/home/#*$!/backup-10.8.2005_07-00-01_yyy.tar.gz";
unlink($oldfile);
?>

However I get a permission denied, what's wrong? Also, I don't know the exact file name, so what I really want to do is wildcard the file name like this:

<?
$oldfile = "/home/xxx/backup-*_yyy.tar.gz";
unlink($oldfile);
?>

Is this possible?

View Replies !
Create A Simple Text Editor That When Used Adds The Text To A .txt File.
I am trying to create a simple text editor that when used adds the text to a .txt file. At the moment im having trouble with the formatting of the text in terms of new lines.

If i write in one long sentence the positioning of the text is fine however if i try to use paragraphs extra lines are added in and then the code gets confused and makes parts of the paragraphs titles, shown in bold.

View Replies !
Using Php To Delete A File In A Directory- Help
I can use php to execute the cp command to copy an image file into a directory.

Now I want to delete images in that directory if they are not named "picturelink.gif" when an entry with a corresponding id is deleted.

Below is the code I am using which doesn't seem to be working when it comes to deleteing the file. The directory has the correct permissions for read/write access.

$query = "DELETE FROM $userstable WHERE id ='$id' ";

if($picture != "picturelink.gif")
{
exec("rm $picture /virtualhosts/capefearantiques.com/www/pictures/$picture");
}

View Replies !
Delete Lines From File:
How to delete $n first lines from $str if i know how much lines shuld remain in the string?

$str = "aaaaaaaaa
bbbbbbbb
ccccccccc
ddddddddd
...
zzz";

Can it be done easly with preg_replace? (i.e without splitting it by '', removing elements from array and joining tham back.

View Replies !
How Do You Delete A File From A Listing Please?
I have the code:

<?php
if ($dir = @opendir("../project/proj_images")) {
while (($file = readdir($dir)) !== false)
if($file != ".." && $file != ".")
echo "<tr><td align="left" class="bodyblue2">$file</td></tr>";
closedir($dir);
}
?>

which displays a list of files in a directory.

What I want, is to be able to click on a file in the list and delete it.

I know you use unlink but how do you tie it in with the above code?

View Replies !
Can I Delete A File From A PHP Script?
Is it possible to delete a file(a jpg in fact) from a PHP script. I would like to ad this functionality to an existing script that deletes a record from a MySQL db. Only the image name is stored in the db.

View Replies !
Trying To Delete A File Using Unlink
i am trying to delete a file using the unlink function but it just is not working. i just get the Could not delete message. Is there anyway to find out exactly what is wrong? I've tried the exact path which is C:/domain/wwwroot/temp/0000000.txt but it just does not delete. Also i dont think it can be related to permissions because the 0000000.txt was created automatically by a script. The code i used is as follows:

<?
$delete = unlink("C:/domain/wwwroot/temp/0000000.txt");

if($delete)
{
echo "Succesfully Deleted";
}
else
{
echo "Could not Delete";
}
?>

View Replies !
Php File Delete Form
How would i go about making a file delete form in php. so that the user can delete .jpg and .gif files from a web directory.

View Replies !
How To Delete Last Line Of File
I have a flat file on the server which I append to from a HTML web form.
I need to delete the last line of the flat file before I append though.

How do i do that?

I have the following code. I'm not sure if it's correct.

$pattern = "</member>"; // what I want to look for.
$ora_books = preg_grep($pattern, file('/path/to/your/file.txt'));

View Replies !
How Can I Have Permissions To Delete A File?
How can I have permissions to delete a file? example: I have to delete a file, but I don't to public users have permission to delete that file but, with a certain "login" they can.

View Replies !
Delete Lines From A File
Can someone show how I open a file and delete everything in it except for the last 20 lines.

View Replies !
Use PHP To Delete An External File?
Is there any way to use PHP to delete an external file?

View Replies !
How To Delete N Lines From The Top Of A File?
I'm not sure how to do this in php - need to calculate and delete an unspecified
number of lines from the *top* of a file.

<?php
//append $visitor to the bottom of $visdata
$fp = fopen($visdata,"a");
fwrite($fp, "
".$visitor;)
//count the lines in $visdata
$lines = count($visdata);
if $lines > 10
{
//delete as many lines off the top as necessary
//to end up with 10 lines total in $visdata
}
fclose($fp);
?>

View Replies !
How To Delete Log File In The Given Period
I dont have much knowledge og PHP. i need to delete log files in the given period. so i need to know how to delete file content using php. i know how to read file content. but i dont know how to delete file content.

View Replies !
Delete File Contents
Can someone post some code to show me how to delete a file from a folder please? I need to delete a file first, and then upload something in it's place. Maybe a bit of code to slide in what i have already would work? Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved