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

Multi Level Array Problem
hi all,

For example I have array like below:

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

How to separate records and ORDER BY
Let say i have 100 records and displayed in one page, then i want to get the records from 50-100 and

Word filter problem
Hello,

im trying to make a filter for words inputted in to my website but i want to store the

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

Keeping track of php uploads
Hello all.

I was looking at the way PHP handles file uploads.
It seems that PHP uses a tem

Retrieving innerHTML with cURL?
Hey all (sorry I know I'm a leecher, but I soon won't be. This is my first PHP project, but not my l

Including calander to page - will not show other months than current??
im trying to add an existaing calander onto a profile page by using Code: <?php include "

Formatting echo from database
So I have a database that stores First and last names, then echos them back to a website, as of now

What's best way to get a user's Word doc converted to simple html and images?
Hi all,

I was just wondering if anybody has any experience of this.
Basically, I'm buildin

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

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