Jump to content

php image


CaTaLinU

Recommended Posts

<?
header("Content-type: image/png");
// ---------------------------------------------------------+ - +--------------------------------------------------------- \\
include ('config.php');
// ---------------------------------------------------------+ - +--------------------------------------------------------- \\
$img = imagecreatefrompng("imagine.png");
$culoare_alb = imagecolorallocate($img,255,255,255);
$culoare_rosu = imagecolorallocate($img,255,0,0);
$culoare_albastru = imagecolorallocate($img,27,27,224);
$culoare_verde = imagecolorallocate($img,37,224,27);
$username = $_GET['p'];
// ---------------------------------------------------------+ - +--------------------------------------------------------- \\
if(isset($_GET['p']))
{
$username = $_GET['p'];
$respect = FTP_pini_Get($username.".ini",'Respect',$host,$user,$password,$path);
$level = FTP_pini_Get($username.".ini",'Level',$host,$user,$password,$path);
$sex = FTP_pini_Get($username.".ini",'Sex',$host,$user,$password,$path);
$origin = FTP_pini_Get($username.".ini",'Origin',$host,$user,$password,$path);
$leader = FTP_pini_Get($username.".ini",'Leader',$host,$user,$password,$path);
$member = FTP_pini_Get($username.".ini",'Member',$host,$user,$password,$path);
$age = FTP_pini_Get($username.".ini",'Age',$host,$user,$password,$path);
$deaths = FTP_pini_Get($username.".ini",'Deaths',$host,$user,$password,$path);
$admin = FTP_pini_Get($username.".ini",'AdminLevel',$host,$user,$password,$path);
$paycheck = FTP_pini_Get($username.".ini",'Paycheck',$host,$user,$password,$path);
$ore = FTP_pini_Get($username.".ini",'ConnectedTime',$host,$user,$password,$path);
$helper = FTP_pini_Get($username.".ini",'Helper',$host,$user,$password,$path);
$vip = FTP_pini_Get($username.".ini",'VipLevel',$host,$user,$password,$path);
$money = FTP_pini_Get($username.".ini",'Money',$host,$user,$password,$path);
$bank = FTP_pini_Get($username.".ini",'Bank',$host,$user,$password,$path);
$crimes = FTP_pini_Get($username.".ini",'Crimes',$host,$user,$password,$path);
$phone = FTP_pini_Get($username.".ini",'PhoneNr',$host,$user,$password,$path);
$car = FTP_pini_Get($username.".ini",'Car',$host,$user,$password,$path);
$car2 = FTP_pini_Get($username.".ini",'Car2',$host,$user,$password,$path);
$car3 = FTP_pini_Get($username.".ini",'Car3',$host,$user,$password,$path);
if($respect != '')
{
        imagestring($img,5,2,77,"GameStatus.In",$culoare_albastru);
        imagestring($img,5,170,77,"-",$culoare_rosu);
        imagestring($img,5,185,77,"XXXXXXX",$culoare_verde);
        // ----------+ - +---------- \\
        imagestring($img,3,105,2,"TEXT1",$culoare_alb);
        // ----------+ - +---------- \\
        imagestring($img,3,105,17,"TEXT2",$culoare_alb);
        // ----------+ - +---------- \\
        imagestring($img,3,105,32,"TEXT3",$culoare_alb);
        // ----------+ - +---------- \\
        imagestring($img,3,105,47,"TEXT4",$culoare_alb);
        // ----------+ - +---------- \\
        imagestring($img,3,105,62,"TEXT5",$culoare_alb);
        // ---------------------------------------------------------+ - +--------------------------------------------------------- \\
        imagestring($img,3,185,2,"{$age}",$culoare_rosu);
        // ----------+ - +---------- \\
        imagestring($img,3,220,17,''.$_GET['p'].'',$culoare_rosu);
        // ----------+ - +---------- \\
        imagestring($img,3,235,32,"",$culoare_rosu);
        // ----------+ - +---------- \\
        imagestring($img,3,215,47,"",$culoare_rosu);
        // ----------+ - +---------- \\
    }
    else
    {
    imagestring($img,3,150,3,"that player doesn't exist",$culoare_rosu);
    }
}
else if(!isset($_GET['p']))
{
    imagestring($img,3,150,3,"no player selected",$culoare_rosu);
}

else
{
    imagestring($img,3,150,3,"Error ...",$culoare_rosu);
}

				  
// ---------------------------------------------------------+ - +--------------------------------------------------------- \\
imagepng($img);
imagedestroy($img);
// ---------------------------------------------------------+ - +--------------------------------------------------------- \\
?>

 

gamestatus.in/samp/imagine.php?p=r0bert  -> it doesn't show anything

 

but if i go to gamestatus.in/samp/imagine.php?n=r0bert  -> it says that i havent selected a player

Link to comment
Share on other sites

i had to do two things:

 

1) quote out config.php's include - i can't see that file so i don't know the issue, but quoting that and

2) adding "if(!empty)" to your $username=$_GET['p'] statement. check before you assign.

 

<?php
header("Content-type: image/png");
// ---------------------------------------------------------+ - +--------------------------------------------------------- \\
//include ('config.php');
// ---------------------------------------------------------+ - +--------------------------------------------------------- \\
$img = imagecreatefrompng("imagine.png");
$culoare_alb = imagecolorallocate($img,255,255,255);
$culoare_rosu = imagecolorallocate($img,255,0,0);
$culoare_albastru = imagecolorallocate($img,27,27,224);
$culoare_verde = imagecolorallocate($img,37,224,27);
if (!empty($_GET['p'])){$username = $_GET['p'];}
// ---------------------------------------------------------+ - +--------------------------------------------------------- \\
if(isset($_GET['p']))
{
    $username = $_GET['p'];
    $respect = FTP_pini_Get($username.".ini",'Respect',$host,$user,$password,$path);
    $level = FTP_pini_Get($username.".ini",'Level',$host,$user,$password,$path);
    $sex = FTP_pini_Get($username.".ini",'Sex',$host,$user,$password,$path);
    $origin = FTP_pini_Get($username.".ini",'Origin',$host,$user,$password,$path);
    $leader = FTP_pini_Get($username.".ini",'Leader',$host,$user,$password,$path);
    $member = FTP_pini_Get($username.".ini",'Member',$host,$user,$password,$path);
    $age = FTP_pini_Get($username.".ini",'Age',$host,$user,$password,$path);
    $deaths = FTP_pini_Get($username.".ini",'Deaths',$host,$user,$password,$path);
    $admin = FTP_pini_Get($username.".ini",'AdminLevel',$host,$user,$password,$path);
    $paycheck = FTP_pini_Get($username.".ini",'Paycheck',$host,$user,$password,$path);
    $ore = FTP_pini_Get($username.".ini",'ConnectedTime',$host,$user,$password,$path);
    $helper = FTP_pini_Get($username.".ini",'Helper',$host,$user,$password,$path);
    $vip = FTP_pini_Get($username.".ini",'VipLevel',$host,$user,$password,$path);
    $money = FTP_pini_Get($username.".ini",'Money',$host,$user,$password,$path);
    $bank = FTP_pini_Get($username.".ini",'Bank',$host,$user,$password,$path);
    $crimes = FTP_pini_Get($username.".ini",'Crimes',$host,$user,$password,$path);
    $phone = FTP_pini_Get($username.".ini",'PhoneNr',$host,$user,$password,$path);
    $car = FTP_pini_Get($username.".ini",'Car',$host,$user,$password,$path);
    $car2 = FTP_pini_Get($username.".ini",'Car2',$host,$user,$password,$path);
    $car3 = FTP_pini_Get($username.".ini",'Car3',$host,$user,$password,$path);
    if($respect != '')
    {
        imagestring($img,5,2,77,"GameStatus.In",$culoare_albastru);
        imagestring($img,5,170,77,"-",$culoare_rosu);
        imagestring($img,5,185,77,"XXXXXXX",$culoare_verde);
        // ----------+ - +---------- \\
        imagestring($img,3,105,2,"TEXT1",$culoare_alb);
        // ----------+ - +---------- \\
        imagestring($img,3,105,17,"TEXT2",$culoare_alb);
        // ----------+ - +---------- \\
        imagestring($img,3,105,32,"TEXT3",$culoare_alb);
        // ----------+ - +---------- \\
        imagestring($img,3,105,47,"TEXT4",$culoare_alb);
        // ----------+ - +---------- \\
        imagestring($img,3,105,62,"TEXT5",$culoare_alb);
        // ---------------------------------------------------------+ - +--------------------------------------------------------- \\
        imagestring($img,3,185,2,"{$age}",$culoare_rosu);
        // ----------+ - +---------- \\
        imagestring($img,3,220,17,''.$_GET['p'].'',$culoare_rosu);
        // ----------+ - +---------- \\
        imagestring($img,3,235,32,"",$culoare_rosu);
        // ----------+ - +---------- \\
        imagestring($img,3,215,47,"",$culoare_rosu);
        // ----------+ - +---------- \\
    }
    else
    {
        imagestring($img,3,150,3,"that player doesn't exist",$culoare_rosu);
    }
}
else if(!isset($_GET['p']))
{
    imagestring($img,3,150,3,"no player selected",$culoare_rosu);
}

else
{
    imagestring($img,3,150,3,"Error ...",$culoare_rosu);
}


// ---------------------------------------------------------+ - +--------------------------------------------------------- \\
imagepng($img);
imagedestroy($img);
// ---------------------------------------------------------+ - +--------------------------------------------------------- \\
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.