File: /home/httpd/html/baretube.com/admin/pornstars_bulk_add.php
<?
ignore_user_abort();
ini_set('max_execution_time',86400);
require "header.php";
if($_POST[dump]) {
unset($arr);
$arr = explode("\n",$_POST[dump]);
$counter = 0;
$errors = 0;
$import = $arr;
foreach($import as $i) {
$i = mysql_real_escape_string($i);
if(mysql_num_rows(mysql_query("SELECT name FROM pornstars WHERE name = '$i'")) < 1) {
if(mysql_query("INSERT INTO pornstars (name) VALUES ('$i')")) {
$counter++;
} else {
$errors++;
}
}
}
$message = "<p><strong>$counter pornstars. $errors were not added.</strong></p>";
}
?>
<div id="right_column">
<div id="right_top">
<div id="right_home"></div>
<div id="right_right">
<a href="index.php">Admin Home</a>
<span><a href="pornstars_bulk_add.php">Bulk Add Pornstar</a></span>
</div>
</div>
<div id="right_bg">
<h2>Pornstar<strong>Import</strong></h2>
<? if($message) { echo $message; } else { ?>
<p>You can bulk import model names using this page, one model per line.
</p><? } ?>
<div id="index_left" style='width: 100%;'>
<form id="form1" name="form1" method="post" action="">
<p><strong>Dump:</strong> <br />
<textarea name="dump" style='width: 98%;' rows="10" id="dump" wrap='off'></textarea>
</p>
<input type='submit' name='submit' value='Submit' />
</form>
</div>
</div>
<div id="right_bottom"></div>
</div>
</div>
</div>
<? require "footer.php"; ?>