st0rmer Posted October 26, 2007 Share Posted October 26, 2007 I am making a simple mailing list, and i have created a form which adds a persons email to a php document. I'm not sure about how i woould remove an email from the php document though? Any ideas? Quote Link to comment Share on other sites More sharing options...
phpknight Posted October 26, 2007 Share Posted October 26, 2007 You probably want a database for this. Quote Link to comment Share on other sites More sharing options...
st0rmer Posted October 26, 2007 Author Share Posted October 26, 2007 But could i do it without a database? Quote Link to comment Share on other sites More sharing options...
premiso Posted October 26, 2007 Share Posted October 26, 2007 Its a pain in the butt. Basically you load all the emails into an array using www.php.net/file From that you loop through writing the emails to the file and making sure you do an if check to omit the email you want removed. Quote Link to comment Share on other sites More sharing options...
phpknight Posted October 26, 2007 Share Posted October 26, 2007 Trust me. Use a database. From a design standpoint, that makes for a big headache down the road. Quote Link to comment Share on other sites More sharing options...
st0rmer Posted October 26, 2007 Author Share Posted October 26, 2007 OK, i'll do some research on what you've said premiso The reason i can't use a daatabase is that i need toi do this at a school, where php is available but mysql is not. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted October 26, 2007 Share Posted October 26, 2007 use a text file: <?php $fileName = "location/of/orignal/file/my_file.txt"; $handle = fopen($fileName, "r"); while (!feof($handle)){ $text = fgets($handle); echo $text; } ?> place one email on each line, then instead of echo $text; use the mail function. Quote Link to comment Share on other sites More sharing options...
st0rmer Posted October 27, 2007 Author Share Posted October 27, 2007 Any ideas on removing the emails fom the text document then The Little Guy? Quote Link to comment 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.