Jump to content


Photo

help


  • Please log in to reply
3 replies to this topic

#1 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 25 April 2006 - 03:03 PM

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?

#2 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 25 April 2006 - 03:05 PM

an input box as in <TEXTAREA> or <INPUT TYPE=TEXT> ??
wisewood: proven fact, I am both wise, and wooden.

#3 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 25 April 2006 - 03:23 PM

textarea

#4 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 26 April 2006 - 01:53 PM

i sent you a PM with the answer, but came up with this instead.

<?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++;
        }
    }
}
?>

wisewood: proven fact, I am both wise, and wooden.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users