Re: working with file and mail
| From: | Kevin Stone | Date: | Mon, 03 Mar 2003 21:56:30 +0000 |
| Subject: | Re: working with file and mail | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137970@lists.php.net to get a copy of this message | ||
Impossible. The list() = split() construct will initialize any variables
that do not contain values so it cannot possibly be a security risk. User
100 cannot possibly see user 99's email address unless user 99's email
address is on line 100. If you want to be absolutely certain then
initialize your variables before you split the line.
- Kevin
----- Original Message -----
From: "WebDev" <WebDev@browseabit.com>
To: <php-general@lists.php.net>
Sent: Monday, March 03, 2003 5:29 PM
Subject: [PHP] working with file and mail
Hello all
I hat some help last night from John Holmes but I am still stuck with even
more option in the code
My Problem:
I have a text data file of users I wish to email all with custom information
from the file, each line represents a user with 21 seperated datafields (
serperator "|" )
...
User|UserN|UserL|Pass|Email|Country|etc..|etrc..|| etc.||
...
The following code makes the loop a security risk well User 100 sees 99
email address ....
<?php
$fp = fopen ("data/default2.users", "r");
while (!feof ($fp)) {
$buffer = fgets($fp, 4096);
list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email, $Street,
$City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2, $ex3,
$ex4, $ex53, $ex7 ) = split ("\|", $buffer);
$myname = "browseabit";
$myemail = "Email@domain.com";
$contactname = "$Realf $RealL";
$contactemail = "$Email";
$message = "Dear $Realf $RealL message ....";
$subject = "Subject text here";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$myname." <".$myemail.">\r\n";
$headers .= "To: ".$contactname." <".$contactemail.">\r\n";
$headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: Server
mail($contactemail, $subject, $message, $headers);
echo "<font face=\"Arial\" size=\"1\" color=\"#000000\">
mail to $Realf
$RealL done ...</font><br> ";
}
fclose ($fp);
?>
Can somebody please help me with the script ?