I don't take any credits!
Credits go to Spyker710 from ragezone.com
So here it is!
Quote:
Quote:
<?php
// process the script only if the form has been submitted
if (array_key_exists('reset', $_POST)) {
// start the session
include('config.php');
$username = trim($_POST['username']);
$password = trim($_POST['password']);
$username = mysql_real_escape_string($username);
$char = trim($_POST['char']);
$mesocheck = mysql_query('SELECT * FROM meso FROM characters');
$result = mysql_query("SELECT meso, accountid FROM characters WHERE name = '$char' LIMIT 1");
list($meso, $accountid) = mysql_fetch_row($result);
$result = mysql_query("SELECT id, password, salt FROM accounts WHERE name = '$username' LIMIT 1");
list($id, $realpass, $salt) = mysql_fetch_row($result);
$sql = "SELECT * FROM accounts WHERE name = '$username'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
if($realpass == hash('sha512',$password.$salt) && $accountid == $id && $meso >= 100000000 && $loggedin < 1) {
mysql_query("UPDATE accounts SET nxcash = nxcash + 30000 WHERE name = '$username' LIMIT 1");
mysql_query("UPDATE characters SET meso = meso - 100000000 WHERE name = '$char' LIMIT 1");
echo "You have payed 100 mil from $char to get 30k NX for $username !";
} else
echo "There was an error getting you NX. Either 1. You do not have enough money. 2. You do not have the char you listed on that account. 3. You are logged in."; }
// if no match, destroy the session and prepare error message
else {
$message[] = 'Invalid username or password. Please try again.';
}
?>
<!-- start content -->
<div class='welcome'><br>Welcome to the NX Cash shop! 100,000,000 mesos for 30,000 NX! Credits to Spyker710 of RageZone, Spyker of OdinMS.de and xDimMak of OdinMS.de for helping fix the bugs!</div>
<div align="center">
<div class="display">
<?php
if (isset($message)) {
echo '<ul>';
foreach ($message as $item) {
echo "<li>$item</li>";
}
echo '</ul>';
}
?>
</div>
<form id="form1" name="form1" method="post" action="">
<table cellspacing="0" cellpadding="5" width="100%">
<tr>
<td width="50%" align="right" class="list">Username :</td>
<td class="list"><input id="username" type="text" name="username" maxlength="12"></td>
</tr>
<tr>
<td width="50%" align="right" class="list">Password :</td>
<td class="list"><input id="password" type="password" name="password" maxlength="20" /></td>
</tr>
<tr>
<td width="50%" align="right" class="list">Character paying 100 mil :</td>
<td class="list"><input id="char" type="text" name="char" maxlength="12"></td>
</tr>
<tr>
<td align="right" colspan="2"><input id="reset" name="reset" type="submit" value="Buy 30k NX!" /></td>
</tr>
</table>
</form>
</div>
<!-- end content -->
Right now the price is 100 mil for 30k NX. If you wanna change the price or the NX just find these lines
Quote:
Quote:
mysql_query("UPDATE accounts SET nxcash = nxcash + 30000 WHERE name = '$username' LIMIT 1");
mysql_query("UPDATE characters SET meso = meso - 100000000 WHERE name = '$char' LIMIT 1");
Change the 100000000 in the meso to whatever price you want.
Change the 30000 in nxcash to whatever NX you want to sell.
Credits to me for making it, (I'm also Spyker from OdinMS.de, so I didn't copy it from him/me)
Huge thanks to xDimMak of OdinMS.de for helping me fix the bugs.
(Well, the old OdinMS.de =| )
This is a PHP script, so put it in your www folder or wherever you put your PHP stuff.
This is for OdinMS source.
If you use this, please leave in the credits!
Quote:
Quote:
<?php
//-----------Database Details------------------------------------
$host['naam'] = 'localhost'; // my host
$host['gebruikersnaam'] = 'root'; // my database username
$host['wachtwoord'] = ''; // my database password
$host['databasenaam'] = 'odinms'; // my database name
//-----------Status Details--------------------------------------
$serverip = "localhost"; //Replace with your WAN IP if public
$loginport = "7575"; //Don't change
$worldport = "8484"; //Dont' Change
$sql_db = "odinms"; //DB Name
$sql_host = "localhost"; //DB Host
$sql_user = "root"; //DB User
$sql_pass = ""; //DB Password
$logserv_name = "<b>Login Server</b>: "; //Login Status Server Name
$worldserv_name = "<b>World Server</b>: "; // World Status Name
$offline = "<font color =red>Offline</font>"; //Displays Offline Status
$online = "<font color = green>Online</font>"; //Displays Online Status
//-----------Dont Touch This-------------------------------------
$db = mysql_connect($host['naam'], $host['gebruikersnaam'], $host['wachtwoord']) OR die ('Cant connect to the database');
mysql_select_db($host['databasenaam'], $db);
?>
That's the config.php I use lol.
If you get the wrong password error, you may need to change this line
Quote:
Quote:
if($realpass == hash('sha512',$password.$salt)
To this
Quote:
Quote:
if($realpass == hash('sha1',$password.$salt)
Basicly, just change the sha512 to sha1. Although sha512 works for me, it might not for you
Credits go to Spyker710 from ragezone.com
So here it is!
Quote:
Quote:
<?php
// process the script only if the form has been submitted
if (array_key_exists('reset', $_POST)) {
// start the session
include('config.php');
$username = trim($_POST['username']);
$password = trim($_POST['password']);
$username = mysql_real_escape_string($username);
$char = trim($_POST['char']);
$mesocheck = mysql_query('SELECT * FROM meso FROM characters');
$result = mysql_query("SELECT meso, accountid FROM characters WHERE name = '$char' LIMIT 1");
list($meso, $accountid) = mysql_fetch_row($result);
$result = mysql_query("SELECT id, password, salt FROM accounts WHERE name = '$username' LIMIT 1");
list($id, $realpass, $salt) = mysql_fetch_row($result);
$sql = "SELECT * FROM accounts WHERE name = '$username'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
if($realpass == hash('sha512',$password.$salt) && $accountid == $id && $meso >= 100000000 && $loggedin < 1) {
mysql_query("UPDATE accounts SET nxcash = nxcash + 30000 WHERE name = '$username' LIMIT 1");
mysql_query("UPDATE characters SET meso = meso - 100000000 WHERE name = '$char' LIMIT 1");
echo "You have payed 100 mil from $char to get 30k NX for $username !";
} else
echo "There was an error getting you NX. Either 1. You do not have enough money. 2. You do not have the char you listed on that account. 3. You are logged in."; }
// if no match, destroy the session and prepare error message
else {
$message[] = 'Invalid username or password. Please try again.';
}
?>
<!-- start content -->
<div class='welcome'><br>Welcome to the NX Cash shop! 100,000,000 mesos for 30,000 NX! Credits to Spyker710 of RageZone, Spyker of OdinMS.de and xDimMak of OdinMS.de for helping fix the bugs!</div>
<div align="center">
<div class="display">
<?php
if (isset($message)) {
echo '<ul>';
foreach ($message as $item) {
echo "<li>$item</li>";
}
echo '</ul>';
}
?>
</div>
<form id="form1" name="form1" method="post" action="">
<table cellspacing="0" cellpadding="5" width="100%">
<tr>
<td width="50%" align="right" class="list">Username :</td>
<td class="list"><input id="username" type="text" name="username" maxlength="12"></td>
</tr>
<tr>
<td width="50%" align="right" class="list">Password :</td>
<td class="list"><input id="password" type="password" name="password" maxlength="20" /></td>
</tr>
<tr>
<td width="50%" align="right" class="list">Character paying 100 mil :</td>
<td class="list"><input id="char" type="text" name="char" maxlength="12"></td>
</tr>
<tr>
<td align="right" colspan="2"><input id="reset" name="reset" type="submit" value="Buy 30k NX!" /></td>
</tr>
</table>
</form>
</div>
<!-- end content -->
Right now the price is 100 mil for 30k NX. If you wanna change the price or the NX just find these lines
Quote:
Quote:
mysql_query("UPDATE accounts SET nxcash = nxcash + 30000 WHERE name = '$username' LIMIT 1");
mysql_query("UPDATE characters SET meso = meso - 100000000 WHERE name = '$char' LIMIT 1");
Change the 100000000 in the meso to whatever price you want.
Change the 30000 in nxcash to whatever NX you want to sell.
Credits to me for making it, (I'm also Spyker from OdinMS.de, so I didn't copy it from him/me)
Huge thanks to xDimMak of OdinMS.de for helping me fix the bugs.
(Well, the old OdinMS.de =| )
This is a PHP script, so put it in your www folder or wherever you put your PHP stuff.
This is for OdinMS source.
If you use this, please leave in the credits!
Quote:
Quote:
<?php
//-----------Database Details------------------------------------
$host['naam'] = 'localhost'; // my host
$host['gebruikersnaam'] = 'root'; // my database username
$host['wachtwoord'] = ''; // my database password
$host['databasenaam'] = 'odinms'; // my database name
//-----------Status Details--------------------------------------
$serverip = "localhost"; //Replace with your WAN IP if public
$loginport = "7575"; //Don't change
$worldport = "8484"; //Dont' Change
$sql_db = "odinms"; //DB Name
$sql_host = "localhost"; //DB Host
$sql_user = "root"; //DB User
$sql_pass = ""; //DB Password
$logserv_name = "<b>Login Server</b>: "; //Login Status Server Name
$worldserv_name = "<b>World Server</b>: "; // World Status Name
$offline = "<font color =red>Offline</font>"; //Displays Offline Status
$online = "<font color = green>Online</font>"; //Displays Online Status
//-----------Dont Touch This-------------------------------------
$db = mysql_connect($host['naam'], $host['gebruikersnaam'], $host['wachtwoord']) OR die ('Cant connect to the database');
mysql_select_db($host['databasenaam'], $db);
?>
That's the config.php I use lol.
If you get the wrong password error, you may need to change this line
Quote:
Quote:
if($realpass == hash('sha512',$password.$salt)
To this
Quote:
Quote:
if($realpass == hash('sha1',$password.$salt)
Basicly, just change the sha512 to sha1. Although sha512 works for me, it might not for you