remove a ; from emails in textarea


Posted on 16th Feb 2014 07:03 pm by admin

Code: <?php

session_start();

$database_host = "localhost";
$database_username = "";
$database_password = "";
$database_name = "";

$connection = mysql_connect($database_host, $database_username, $database_password) or die(mysql_error());
$db = mysql_select_db($database_name, $connection);

if(!$_POST)
{

echo "<FORM METHOD=POST ACTION=$PHP_SELF>";
echo "<TEXTAREA NAME=my_textarea COLS=30 ROWS=5></TEXTAREA><BR>";
echo "<INPUT TYPE=SUBMIT VALUE=Submit>";
echo "</FORM>";

}
else
{

$entries = explode( "n", $_POST[my_textarea]);

$x=0;

foreach($entries AS $entry)
{

if($entry!=="")
{

$register_sql = "INSERT INTO emails(emails_email) VALUES ('$entry')";
$register_row = mysql_query($register_sql);

echo "$entry added to database
";
$x++;

}

}

}

?>
i have the above code, where you enter emails in a textarea like

email1@hotmail.com
email2@hotmail.com

and then it will put them into my database.

right now what i want to do is adapt the above code to do the same when you put emails in the textarea like..

email1@hotmail.com; email2@hotmail.com

thanks in advance

No comments posted yet

Your Answer:

Login to answer
187 Like 51 Dislike
Previous forums Next forums
Other forums

Adding to an Int row in db
Hi, i have a database which houses all of the users of my site. One of the columns is for points whi

RSS feed - FeedList for WordPress
Hi,

I'm trying to alter the FeedList plugin for WordPress so that I can click on the title of

controlling/creating accounts with privileges
hi all,
i'm trying to figure out how i can create/control account with privileges, for instance a

UL and LI Add Form
The idea I want here is when the user click on a character name from the drop down select bar at the

Can't find the problem (no error message)!
OK, here's the deal. This code is really weirdly formatted (sorry!) and hard to understand, so I'm g

login to other site by sending post variables
hey,

here is my problem: my school gave me a mail account for school-stuff use. they mail us

Code doesn't print what i wanted it too. Please help!
Hi there,

I wrote this code to mae it so that in the form before it that the user said their

Cant display mysql data
Hey all,

I am learning php and my first goal is to create a simple CMS. At the moment I am st

Limiting uploaded file type
Hi. First post here
I am working on a simple upload script, and I need it to limit the allowed f

Navigation include for all site directories
Hi,

I need a navigation include that can deal with directories at different levels on a site.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash