Emails being saved to a list using the php below. There is however a gap being created at the top of the list as the attached image demonstrates. Attachment 4272
Why will the saved emails not start at the top of the field?
PHP Code:
<?php
$List = $_POST['List'];
$Email = $_POST['Email'];
if (file_exists("data/$List")) {
$myfile = file("data/$List");
$fh = fopen("data/$List", "w");
for ($index = 0; $index < count($myfile); $index++) {
if ($Email != rtrim($myfile[$index])) {
fputs($fh, $myfile[$index]);
}
}
fputs($fh, $Email . "\n");
fclose($fh);
} else {
$myfile = fopen("data/$List", "w");
fputs($myfile, $Email . "\n");
fclose($myfile);
}
?>
Bookmarks