Here is the code I used
Code: Select all
<?php
include_once("core/main.php");
//file to use
$listfile = "mail_list_users.txt";
//read file contents into array
$lines = file($listfile);
foreach ($lines as $line)
{
//add each user's email to db
$mlins = "INSERT into mail_list( email, active ) VALUES ( '$line', 'Y' )";
$mlret = db_query($mlins);
}
?>I have no idea why it wont add the entire file
**The main.php file that is included is only the functions for connecting to the db and the header/footer