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. Quote Link to comment https://forums.phpfreaks.com/topic/254755-saving-a-blank-line/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.