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
Help with looping
I have a comma separated list of colors taken from a database ($ICo) and a directory of images named "color". The images are named the "color.jpg"I am attempting to loop through
Little problem with form insertion in MySQL, Please help!!!
Hi!,I'm a little bit new with php and I have a little issue here. I created a webform to insert some infos into a MySQL database. The weird thing is that some of the infos is correctly inserted and
PHP friend keyword equivalent
is there a PHP equivalent for the C++ friend keyword?
Deleted Delivery but material wont return
We deleted a delivery but the material its still pending.
login page does not execute a else statement
I've created a login page using sessions.When an incorrect user name or password is entered then a custom messege error message apears.But if a correct user name and password is used then notthing
Sessions work for me and not others?
I'm having a bit of bad luck with sessions. In the past they have worked fine for me, but this time around I'm having terrible luck. Basically, I made the crappiest login system ever. I'm using
Show specific day of the week
I have been racking my brain trying to get this function to work properly and it is doing so for everything but Sundays. What I am trying to do is display all dates within a specified date range that
Track downloads' status
Hello,I need to make somehow, some system, to track whether downloads are completed or failed. I tried to make this via php.Tried to limit the connection speed for smaller downloads (to have the time
Changing color in GD via variable?
Hey guys, I'm new here. x)I'm very much a noob when it comes to PHP, but I'm trying to learn as much as I can. I've been writing a script which will generate a new image after submitting some hex
Linking with Foreign Keys
I have been getting an erro when I try and link: