PHP Database USER_ID for Paymentwall Widget
#1

Hello Guys,

I need your help. I need a script for the paymentwall widget which read the user_id from database. I dont know how to do it...

 

So, I have a login system from eternia website template from noizy

 

The script of login.php:

<?php
session_start();
error_reporting(0);
?>
<?php

include include/config.php;
include include/functions.php;

If (isset($_POST["username"]))
{
if (empty($_POST[username]) OR empty($_POST[password]))
{
echo "<div class=ferrorbig>Error! one or more fields are empty, please try again</div>";
?>
<?php
die;
}
$conn = new mysqli($ip,$sqluser,$sqlpw,$userdb);
if (mysqli_connect_errno() == 0)
{
$user = $conn->real_escape_string(htmlspecialchars(clean_str($_POST[username])));
$pass = $conn->real_escape_string(htmlspecialchars($_POST[password]));

$realpass = hash("sha256",$user.$salt.$pass);
$query = "SELECT user_id, passwd FROM bg_user WHERE user_id LIKE $user LIMIT 1";
$exec = $conn->query($query);
$res = $exec->fetch_object();
If ($res->passwd == $realpass)
{
$_SESSION["username"] = $user;
?>
<script type="text/javascript">
setTimeout("location.href=#",100);
</script>
<?php
}
Else;
{
echo "<center>PLEASE RELOAD THE PAGE!</center>
<br>
<center><img src=\"images/loading.gif\"></center>
<br>
<center><a href=\"index.php\">CLICK HERE</a></center>
<bt>
";
die;
}
}
}
Else;
{

}
?>
<?PHP
if(!isset($_SESSION[username])) {
?>
<form id="login" action="login.php" name="login">
<table width="225" cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td width="174" height="30">
<div style="background: url(images/loginfield.jpg) no-repeat 0 0 transparent; width: 174px; height: 26px;">
<input id="username" name="username" type="text" tabindex="1" style="background: none; border: none; color: #eeeeee; padding-left: 5px; width: 155px; height: 23px; padding-left: 15px;">
</div>
</td>
<td align="right" width="51" rowspan="2">
<input type="submit" value="" style="border: none;" class="botlogin" tabindex="3" onclick="new Ajax.Updater(container, login.php, {method: post, asynchronous:true, parameters:Form.serialize(document.login)}); esperar(container); return false;">
</td>
</tr>
<tr>
<td>
<div style="background: url(images/loginfield.jpg) no-repeat 0 0 transparent; width: 174px; height: 26px;">
<input id="password" name="password" type="password" tabindex="2" style="background: none; border: none; color: #eeeeee; padding-left: 5px; width: 155px; height: 23px; padding-left: 15px;">
</div>
</td>
</tr>
</table>
</form>
<?PHP
} else {
?>
<?PHP
include include/config.php;
$accid = ;
if(isset($_SESSION[username])){
$accid = $_SESSION[username];
}

$connect = mysql_connect($ip, $sqluser, $sqlpw) or die(mysql_error());
mysql_select_db($userdb) or die(mysql_error());
$sql="SELECT * FROM bg_user,user_id WHERE user_id= $accid";
$result=mysql_fetch_array(mysql_query($sql));
?>
<div style="padding: 0px 7px; line-height: 15px;">
Welcome <b><?php echo $_SESSION["username"]; ?>,</b><br/>
<div class="separator" style="height: 10px;"></div>
Balance: <span id="balance2" name="balance2"><?php echo $result[cash]; ?></span><br/>
<a href="#change_password" onclick="_gaq.push([_trackPageview, .com/s_ep3/index.php/user/change_pass]); new Ajax.Updater(container, include/chp.php, {method: get, asynchronous:true, evalScripts:true}); esperar(container); return false;" />Change your password</a><br/>
<a href="#bl" onclick="_gaq.push([_trackPageview, .com/s_ep3/index.php/user/change_pass]); new Ajax.Updater(container, include/ban_list.php, {method: get, asynchronous:true, evalScripts:true}); esperar(container); return false;" />Banned Characters</a><br>
<a href="#bl" onclick="_gaq.push([_trackPageview, .com/s_ep3/index.php/user/change_pass]); new Ajax.Updater(container, include/ban.php, {method: get, asynchronous:true, evalScripts:true}); esperar(container); return false;" />Banned Accounts</a><br>
<br>
<a href="#logout" onclick="_gaq.push([_trackPageview, .com/s_ep3/index.php/user/logout]); new Ajax.Updater(container, include/logout.php, {method: get, asynchronous:true, evalScripts:true}); esperar(container); return false;" />Logout</a>

</div>
<?PHP
}
?>

Script of Donate.php

<?php
session_start();
error_reporting(0);
?>
<?PHP
if(!isset($_SESSION[username])) {
$usercode = $_SESSION[user_code];
?>
<div class=ferrorbig>You must be logged in to access this page.</div>
<?PHP
} else {
?>

<div class="fbar">
<div class="ftitle">DONATE</div>
<div class="clear"></div>
</div>
<div id="fbody" class="fbody">
<div style="">
<div class="fdesc">Donate, help server to grow up</div>

<iframe src="https://wallapi.com/api/ps/?key=randomkey555414554514&uid=<?php echo $_SESSION["user_code"]; ?>&widget=p1_2" width="750" height="800" frameborder="0"></iframe>
</div>
<div style="height: 5px;"></div>
</div>
</div>
<?PHP
}
?>

So well like i said, I need a script which read the USER_ID of the player who donate and I dont know how to script it..

 

 



Messages In This Thread
[No subject] - by primax16 - 08-04-2013, 01:16 PM
[No subject] - by RomainLastChaos - 08-04-2013, 01:49 PM
[No subject] - by primax16 - 08-04-2013, 02:04 PM
[No subject] - by RomainLastChaos - 08-04-2013, 02:22 PM
[No subject] - by primax16 - 08-04-2013, 04:26 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)