This is only an idea I haven't test this and you'd need to remake the join form to get passwords and write that with the username to another text file where they are joined together...
(this is not a secure method at all however. You should randomize the text file name and not allow directory listings)
PHP Code:
$username = $_POST['leavethepageemail'];
$password = $_POST['password'];
$myotherfile = "SSeCuRe@976535.txt";
$fh = fopen($myotherfile, 'r');
$securedata = fread($fh, 20000000);
fclose($fh);
$getout = str_replace($username . $password, "", $myotherfile);
$checkthat = str_replace($username , "", $myotherfile);
$checkthis = str_replace($password , "", $myotherfile);
if ($checkthat . $checkthis == $getout) {
$leaving = $username;
$myfile = "addresses.txt";
$fh = fopen($myfile, 'r');
$thedata = fread($fh, 20000000);
fclose($fh);
$leaving = $leaving . ', ';
$olddate = $thedata;
$remove = str_replace('Bcc: ' . $leaving, "", $thedata);
$file = "addresses.txt";
$newdata = $thedata;
$handle = fopen($file, 'w');
fwrite($handle, $remove);
fclose($handle);
if ($olddata <> $newdata) {
die ('You have successfully been removed from the mailing list.</body></html>');
}
else
{
die ('There was an error removing your email address from the mailing list please re-enter your email address. If the problem continues please contact the adminastrator.</body></html>');
}
}
else
{
die ('Your username or password were not found please try again.');
}
Oh you'd also want to write it so the username and password leave the secure text file as well
Bookmarks