• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

SqlDump in htdocs WTF is that?

feslir

New Member
Joined
Sep 2, 2007
Messages
241
Reaction score
2
Location
Kosovo
i went to htdocs then i saw this file
sqldump.php anyone can tell me what it is? please

<?php

// database configuratie
$dbname = "abo"; // database naam
$user = "root"; // gebruikersnaam van mysql
$pass = "reevi"; // wachtwoord van mysql
$host = "localhost"; // host naar mysql

mysql_connect($host, $user, $pass) or die ('kan geen verbinding maken met de database');
mysql_select_db($dbname) or die ('kan geen verbinding maken met de database');

// return all available tables
$result_tbl = mysql_query( "SHOW TABLES FROM ".$dbname);

// De variabele $output aanmaken.
$output = '';
while ($row = mysql_fetch_row($result_tbl)) { // De tabellen aanmaken
// Tabel naam
$table = $row[0];
// Tabel creeren
$output .= "\n\n\tCREATE TABLE ".$table." (\n";
// De velden van deze tabel selecteren
$result_fld = mysql_query( "SHOW FIELDS FROM ".$table);
$aant = mysql_num_rows($result_fld);
// Teller beginnen
$i = 0;
while($row1 = mysql_fetch_row($result_fld)) {
// teller op laten tellen
$i++;
// De veldnaam - soort - auto_increment
$output .= "\t\t".$row1[0]." ".$row1[1]." ".$row1[5];
if($aant != $i){
// Als dit niet het laatste veld is een komma erachter plakken
$output .= ",\n";
}
// Als het veld een primary key is
if($row1[3] == 'PRI'){
$output .= "\t\tPRIMARY KEY (".$row1[0].")";
// Als dit niet het laatste is, nog een komma erachter zetten
if($aant != $i){
$output .= ",\n";
}
}
}
// Create table afsluiten
$output .= "\n\t);\n\n";

// De data uit deze tabel selecteren
$insrt_sql = "SELECT * FROM ".$table;
$insrt_res = mysql_query($insrt_sql);
while($ins = mysql_fetch_row($insrt_res)){
// De INSERT INTO starten
$output .= "\tINSERT INTO ".$table." VALUES (";
for($i=0;$i<count($ins);$i++){
if(is_numeric($ins[$i])){
// Als het een numerieke waarde is hoeven er géén quotes omheen
$output .= $ins[$i];
}else{
// Anders dus wel
$output .= "'".$ins[$i]."'";
}
if($i+1<count($ins)){
// Als dit niet het laatste veld is van de rij een komma plaatsen
$output .= ',';
}
}
// De INSERT INTO afsluiten
$output .= ");\n";
}
}

// Alles op het scherm toveren
echo '<pre>';
echo htmlentities($output);
echo '</pre>';

?>
 
$result_tbl = mysql_query( "SHOW TABLES FROM ".$dbname);
shows all tables inside the database.

$result_fld = mysql_query( "SHOW FIELDS FROM ".$table);
Shows all fields inside the table.

$insrt_sql = "SELECT * FROM ".$table;
Shows the value of all fields.

Seems like you got hacked xd..

Try going to localhost/sqldump.php and see what is does.

No need, i can tell you right now ;] it will show every available tables of the database, and it will show all fields inside those tables, and it will show all the values inside those fields too :)
 
Last edited by a moderator:
Back
Top