rendered paste body<?
if (isset($_POST['stats'])) {
$text = $_POST['stats'];
$userid=$_SESSION['user_id'];
//split the data into lines to be processed one by one
$line=explode("\n", "$text");
$shipid=0;
//work through each line of data
foreach($line as $value){
$info=explode("\t", "$value");
if (empty($info[14])) {exit;}
$race=$info[14]; if ($race == "Cath") {$race="Cat";}
$type=$info[3]; if ($type == "Norm") {$type="N"} elseif ($type == "Emp") {$type="E"} elseif ($type == "Cloak") {$type="C"} elseif ($type == "Steal") {$type="S"} elseif ($type == "Pod") {$type="P"} elseif ($type == "Struc") {$type="K"}
//Harpy Fighter Frigate Norm 7 1 23 17 85 140 110 110 638 472 Ter
INSERT INTO `subh_sstats` ( `ship_id` , `name` , `class` , `target` , `type` , `init` , `guns` , `armor` , `damage` , `empres` , `metal` , `crystal` , `eonium` , `ac` , `dc` , `race` )
VALUES (NULL, '".$info[0]."', '".$info[1]."', '".$info[2]."', '".$type."', '".$info[4]."', '".$info[5]."', '".$info[6]."', '".$info[7]."', '".$info[8]."', '".$info[9]."', '".$info[10]."', '".$info[11]."', '".$info[12]."', '".$info[13]."', '".$race."')
}
}
?>