The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled HTML Code
Posted by: Jeff | February 15, 2011 @ 1:43pm
HTML Code
[
Download
]
<h2>DKP</h2> <form method="POST" action="dkp.php"> <p>Enter one or more queries separated by newlines:</p> </p> <table width = 1000> <tr> <th width = 300>Name</th><th>Item</th> </tr> </table> <textarea name="sites" rows = "7" cols = "120" wrap = "Off"></textarea> <p><input type="submit"> <input type="reset"></P> </form> <?php function mysql_insert_array($table, $data) { foreach ($data as $field=>$value) { $fields[] = '`' . $field . '`'; $values[] = "'" . mysql_real_escape_string($value) . "'"; } $field_list = join(',', $fields); $value_list = join(', ', $values); $query = "INSERT INTO `" . $table . "` (" . $field_list . ") VALUES (" . $value_list . ")"; return $query; } if(isset($_POST['raidData'])) { $raidInput = $_POST['raidData']; } if(isset($raidInput)) { $newArr = explode("\r\n", $raidInput); foreach ($newArr as $key => $value) { if(is_null($value) || empty($value)) { unset($newArr[$key]); } else { $newArr[$key] = trim($value); } } } $nameArr = ""; $itemArr = ""; foreach($newArr as $line) { $arr = explode("\t", $line); if($nameArr == "") { $nameArr = array($arr[0]); } else { $nameArr[] .= $arr[0]; } if($itemArr == "") { $itemArr = array($arr[1]); } else { $itemArr[] .= $arr[1]; } } mysql_connect; mysql_select_db; mysql_insert_array($table, $nameArr); mysql_insert_array($table, $itemArr); ?>
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
5.70 / 8
122 Votes
http://codebin.yi.org/1125
page generated in 0.01 seconds