brown2005 Posted April 25, 2006 Share Posted April 25, 2006 i have a input box where i want to say putabcinto it......and then enter 3 records into a databse table in mysql..how can i do this? Link to comment https://forums.phpfreaks.com/topic/8373-help/ Share on other sites More sharing options...
wisewood Posted April 25, 2006 Share Posted April 25, 2006 an input box as in <TEXTAREA> or <INPUT TYPE=TEXT> ?? Link to comment https://forums.phpfreaks.com/topic/8373-help/#findComment-30586 Share on other sites More sharing options...
brown2005 Posted April 25, 2006 Author Share Posted April 25, 2006 textarea Link to comment https://forums.phpfreaks.com/topic/8373-help/#findComment-30597 Share on other sites More sharing options...
wisewood Posted April 26, 2006 Share Posted April 26, 2006 i sent you a PM with the answer, but came up with this instead.[code]<?phpif(!$_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] Link to comment https://forums.phpfreaks.com/topic/8373-help/#findComment-30931 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.