Showing skin image in PHP
#1

Hello. How do I make my website display the skin image depending on what the players skin ID is saved in the database?
I have a Skins folder inside my website home directory and every skin image is saved like 0.jpg for CJ etc.

PHP код:
<?php 
include 'Config.php';
$signame $_GET['User'];
if (
$signame)
{
    
$connect mysql_connect($dbhost$dbuser$dbpass) or die ("Cannot Connect");
    
mysql_select_db($dbname) or die ("Data Base was not found");
    
$query "SELECT * FROM Accounts WHERE Name = '$signame'";
    
$results mysql_query($query);
    while(
$row mysql_fetch_array($results)) 
    {
        
$username $row['Name'];
        
$Score $row['Level'];
        
$Cash $row['Cash'];
        
$Bank $row['Bank'];
        
$House $row['House'];
        
$Skin 'Skins/';
        
$Skin .= $row['Skin'];
        
$Skin .= '.jpg';
        echo 
'' .$Skin'<br><br>'/* This just displays "Skins/34.jpg", I need it to fetch the image from folder */
        
echo 'Character:   ' .$username'<br>';
        echo 
'Level: ' .$Score'<br>';
        echo 
'Cash:   $' .$Cash'<br>';
        echo 
'Bank:   $' .$Bank'<br>';
        if(
$House != 0)
        {
            include 
'House.php';
        }
        else
        {
            echo 
'Address: None';
        }
    }
} else die(
"Didn't log in to check the database.");
?>
Reply


Messages In This Thread
Showing skin image in PHP - by AphexCCFC - 01.05.2014, 15:49
Re: Showing skin image in PHP - by Luis- - 01.05.2014, 16:08
Re: Showing skin image in PHP - by AphexCCFC - 01.05.2014, 17:02
Re: Showing skin image in PHP - by Luis- - 01.05.2014, 17:31

Forum Jump:


Users browsing this thread: 1 Guest(s)