Jump to content

Archived

This topic is now archived and is closed to further replies.

brown2005

help

Recommended Posts

i have a input box where i want to say put

a
b
c

into it......

and then enter 3 records into a databse table in mysql..

how can i do this?

Share this post


Link to post
Share on other sites
an input box as in <TEXTAREA> or <INPUT TYPE=TEXT> ??

Share this post


Link to post
Share on other sites
i sent you a PM with the answer, but came up with this instead.

[code]
<?php
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!=="")
        {
        // YOUR INSERT QUERY GOES HERE

        echo "$entry added to database<br>";
        $x++;
        }
    }
}
?>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.