Código PHP:
<?php
ini_set("ignore_user_abort", 1);
ini_set("set_time_limit", 0);
ini_set("max_execution_time", 0);
require_once("../inc/valuescript.func.php");
require_once("../config.php");
$sql = "SELECT ID FROM websites WHERE `ID` = '1'";
$result = @mysql_query($sql);
if($result) {
print "Already Installed....";
exit;
}
$sql = my_read_file("./valuedb.sql");
$result = @mysql_query($sql);
if(!$result) {
print "Can't create table....";
exit;
}
@mysql_query("OPTIMIZE TABLE `websites`");
$handle = fopen("./sites.csv", "rb");
print "Please Wait....";
flush();
$i = 0;
while (!feof($handle)) {
$dumpline = "";
while (!feof($handle) && substr ($dumpline, -1) != "\n")
$dumpline .= fgets($handle, 8192);
$lne = $dumpline;
$lne = ereg_replace("\n", '', $lne);
$lne = ereg_replace("\r", '', $lne);
$lne = explode(",", $lne);
$lne = url2Domain($lne[1]);
$DateAdd = date("Y-m-d H:i:s");
$rnd = mt_rand(0,1);
if(is_integer($i/50000)) { print "<br>$i sites addedd... wait..."; flush();}
if($lne!="")
mysql_query("INSERT INTO `valuedb`.`websites` (`ID` ,`LastUpdate` ,`Domain` ,`Pageview` ,`Visitors` ,`Revenue` ,`Dmoz` ,`Rank` ,`Backlinks` ,`Pagerank` ,`Worth` ,
`About` ,`NewMark` ,`TotalViews`)VALUES (NULL , '$DateAdd' , '$lne', '', '', '', '', '', '', '', '', '', '$rnd', '0');");
$i++;
}
fclose($handle);
print "<BR><BR>Optimization....";
flush();
@mysql_query("OPTIMIZE TABLE `websites`");
print "<BR><BR><BR>Database sucesfully installed";
flush();
?>