<?php
if(isset($_POST['submit'])) {
//$email = nl2br($_POST['email']);
$email = explode("\r\n", $_POST['email']);
foreach($email as $emails) {
$query = mysql_query("INSERT INTO emails (email) VALUES ('$emails')");
if($query) {
echo "Inserted into the database";
} else {
echo "Fail, please try again";
}
}
}
?>
<body>
<form name="form1" method="POST">
<textarea rows="5" name="email" cols="50" ></textarea>
<br />
<input type="submit" name="submit" value="submit">
</form>
</body>