webiter1 Posted January 10, 2012 Share Posted January 10, 2012 Not sure if the image is attaching so I will give this http://www.postbox.webitry.net/ to the test position and go to >Edit/Delete E-mails from a List > Edit Selected List to view gap at top of list. I am saving submitted emails to a list as in a flatfile. As an email is saved there is also a blank line being saved as in the image attached. Why is this happening? The php code is below. //WRITE VALIDATED EMAIL TO LIST $List = $_POST['List']; 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); } Not sure if the image is attaching so I will give this http://www.postbox.webitry.net/ to the test position and go to >Edit/Delete E-mails from a List > Edit Selected List to view gap at top of list. Link to comment https://forums.phpfreaks.com/topic/254755-saving-a-blank-line/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.