remove a ; from emails in textarea


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

Code: <?php

session_start();

Did you know?Explore Trending and Topic pages for more stories like this.
$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

Preg_match unknown modifyer
Hello,

Im trying to write a little script for my forums i need to get the reply from my forum

Multiple includes losing variables
Hey all,

just starting out w php and ran into a problem pretty quickly. I'm
including seve

Small problem with image resize script
Hi!

I am a little bit new to php and I have an issue installing an image resize script I down

Multi Level Array Problem
hi all,

For example I have array like below:

$temp = array(array('north america', 'us'

want a code for uploading and downloading
i m trying to upload and download to my site..i need upload and download code ...i use a code for up

Count
Getting the same count everytime

Code:
$visitquery = mysql_query("SELECT COUNT(*) FR

Problem with PHP code- simple contact form
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form wit

Best way to check for end of a record and send it back to the first record
I'm hoping someone can help me out and explain the best way to accomplish this.

What I'm doin

Displaying returned XML in another PHP page
I have an online payment form that will return XML given if a payment is successful or declines. I

Problems with strings containing
Hey all,

I have encountered something strange in a script. I am trying to write an XML heade

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