Jump to content

Recommended Posts

Posted

After you're done with this guide [Guide]How To Make PHP Ready For Mssql Connection , create a file on your webserver with php extension then insert the next code inside:

 

<?php

// Credits to me

// Sript Configuration
$type = "1";                                // 1 for top PVP, 2 for top PK
$count = "10";                            // Top Limit Players( Ex Top 10 PvP/Pk)


// DataBase Connection Informations
$host = "localhost";                    // DataBase Host: Default: localhost
$user = "sa";                             // DataBase User: Default: sa
$password = "yourpassword";    // DataBase Password
$database = "lin2world";            // Database Name: Default: lin2world

if($type == "1"){
$type = "Duel";
}
elseif($type == "2"){
$type = "PK";
}
else{
echo "<font color='red'>Invalid Type!</font>";
}

if($type == '1' || $type == '2'){
$dbconn = mssql_connect($host, $user, $password)
 or die("Connection to $host cannot be reached."); 
$dbslect = mssql_select_db($database, $dbconn)
 or die("The database $database can't be opened.");

function is_int_val($data) {
if (is_int($data) === true) return true;
elseif (is_string($data) === true && is_numeric($data) === true) {
return (strpos($data, '.') === false);
}
return false;
}

if(!is_int_val($count) || $count < '1'){
echo "<font color='red'>Invalid Count Data</font>";
}
else{
$select = "SELECT Duel,PK,char_name FROM user_data WHERE $type >='0' ORDER BY $type DESC LIMIT $count;";
$query = mssql_query($select);

if($type == '1'){
$type = "PvP's";
$type2 = '0';
}
elseif($type == '2'){
$type = "PK's";
$type2 = '1';
}

echo "<table align='center' border='1'><tr><td><b>#</b></td><td><b>Name</b></td><td><b>$type</b></td></tr>";
$i = '1';



while($row=mssql_fetch_row($query)){
$charname = htmlspecialchars($row[2]);

echo "<tr><td>$i</td><td>$row[2]</td><td>$row[$type2]</td></tr>";

$i++;
}

echo "</table>";

}
mssql_close($dbconn);
}

?>

Posted

"Secure".... Just create new sql user with read only for the top pvp/pk raid scripts =) also set wamp under unprivilegued rdp user.

 

I know but for that persons who don't know how to create & set privileges to a user what they do? and btw someday while I was searching on a forum(I don't tell the name) I found a top pk/pvp script , specially made to be vulnerable at sql inject.so..

  • Vision changed the title to Secured Top PvP,Pk Scripts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock