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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...