[Tool/Web/Other] [PHP/SQL] View Bans/Vehicles/Users from browser
#1

Before we start. You will need to have an MySQL-able gamemode, an sql server and .php supporting server (doesnt count what OS). Otherwise it will NOT work!

What is it? The .zip file contains 3 *.php files: users.php, bans.php and vehicles.php. If they are correctly set up, you can view your info for these three things from sql in your web browser. Also the zip contains graphical files, css and js files. Also config.inc.

Preview. HERE

Setting up. Download the package (Link is in the end of the post) unpack them to your desktop or somewhere.
Open up config.inc and configure it for your needs
PHP код:
define ("DB_HOST""localhost"); // set database host
define ("DB_USER""root"); // set database user
define ("DB_PASS","x"); // set database password
define ("DB_NAME","sa-mp"); // set database name    
define ("DB_TABLE_VEHS","vehicles"); // set database table for vehs    
define ("DB_TABLE_PLAYER","playerinfo"); // players
define ("DB_TABLE_BANS","bans"); //bans 
It should be no hard.

Next open up one of the .php files. I use Notepad++. For example i open users.php.
Firstly you will need to edit these lines:
PHP код:
$db_table_player DB_TABLE_PLAYER;
$sql="SELECT * FROM $db_table_player"
It has to be same as in config.inc

Now we need to edit these lines for your needs
PHP код:
$user = ($rows['user']);
$money = $rows['money']; 
$skin = $rows['skin'];
$Level = $rows['Level'];  
$nLevel = $rows['nLevel'];
?>
<tr>
<td class="alt" ><?php echo "$user"?></td>
<td class="alt" ><?php echo "$money"?></td>                
<td class="alt" ><?php echo "$skin"?></td>
<td class="alt" ><?php echo "$Level"?></td>
<td class="alt" ><?php echo "$nLevel"?></td>
PHP код:
$user = ($rows['user']); 
if in mysql you have named your row for usernames to usernames, instead of users, it has to be
PHP код:
$usernames = ($rows['usernames']); 
, also you need to edit the following line:
PHP код:
<?php echo "$user"?>
to
PHP код:
<?php echo "$usernames"?>
Same for the other lines and other 3 files.

Download
Upload.ee
Solidfiles.com

The .inc replaced with .php
Solidfiles.com
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)