Hi I am trying to figure out a way to take email address out of a text field box and insert them as new records into a database.

I created a page with a text field and a add button.

As an example, I want to be able to paste more than one email address into the text field box. The email addresses will be seperated by commas like this (user123@blah.com, user234@blah.com, user345@blah.com, user456@blah.com and so on.) When I press the add button I want to be able to extract the emails and add them into the database as thier own entries as new email adresses. I was trying to configure a script using foreach but I can not figure out exactly how to do this.
I do not know how to extract each email individually from the text field and how to list them as a variable and enter them into the db...

Can anyone help me with this PLEASE. I am lost.

This is what I had come up with so far.
Code:
if(isset($_POST[s1]))
{

foreach (??? ????) {
        $q1 = "Insert into mail set
                                        email = '" . xss_clean(addslashes($_POST['email'])) . "'";

        mysql_query($q1);

        if(mysql_error())
        {
                echo mysql_error();
        }
        else
        {
        echo "<br><center><font face=verdana size=2 color=red><b>You have sucessfully added the subscribers!";
        exit();
        }

                           }
}


//get the subscribers number
$q1 = "select count(*) from mail where news = 'y' ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);


?>

<script>

        function CheckNews() {


                if(document.f1.message.value=="")
                {
                        window.alert('Enter the new emails!');
                        document.f1.message.focus();
                        return false;
                }

        }

</script>

<form method=post name=f1 onsubmit="return CheckNews();">
<table align=center width=350>
<caption align=center class=BlackLink>You have <?=$a1[0]?> subscribers at your mailing list.<br>
Would you like to add more subscribers?</caption>
<tr>
        <td colspan=2 class=TableHead align=center>Add more subscribers!</td>
</tr>

<tr>
        <td valign=top>Add Emails to the DB:</td>
        <td><textarea name=message rows=10 cols=32></textarea></td>
</tr>

<tr>
        <td>&nbsp;</td>
        <td><input type=submit name=s1 value=Add! class=sub></td>
</tr>
</table>

</form>