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

Read from a text file after a specific word
Hi all.

I have a text file that looks like the one below.
I know how to open the text fi

my sql select id and then update problem.
I need to select some auto incremented ids out of a database and then use those id in a where statem

confused between ' ' and " "
there is a php i set:
$begin_date_query = mysql_query( "SELECT SUBDATE(due_date, INTERVAL $d

php mysql script to find record
Hi,

Currently I have a simple table with 4 columns. A, B, C, D

If I want to find all

Mail functionality from localhost to server
Hi

I am facing problem of mail functionality.

When i tested mail functionality in my

php redirecting
i wont open a new thread but i have a question about redirecting....
i wonder why my code doesnt

Locking mysql tables with php
Hi

BACKGROUND:
I have multiple instances of the same php script running in a WAMP environ

Multidimensional $_POST
Hello

How to get a single array from array of array (2 - dimension).
For example I have a

Inserting 100x and 100y coordinates in mysql table - easy
Is there a way to insert this data into a mysql table named 'map' with the fields: 'x int 3' , 'y in

Add trigger to UpdatePanel programmatically
Hi,I'm working on a website which uses AJAX and Masterpages. What I have is an AJAX UpdatePanel whi

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