CaTaLinU Posted February 11, 2012 Share Posted February 11, 2012 <? 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 Quote Link to comment https://forums.phpfreaks.com/topic/256882-php-image/ Share on other sites More sharing options...
CaTaLinU Posted February 11, 2012 Author Share Posted February 11, 2012 sorry for double , but someone can help me please ? Quote Link to comment https://forums.phpfreaks.com/topic/256882-php-image/#findComment-1316966 Share on other sites More sharing options...
digibucc Posted February 11, 2012 Share Posted February 11, 2012 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); // ---------------------------------------------------------+ - +--------------------------------------------------------- \\ ?> Quote Link to comment https://forums.phpfreaks.com/topic/256882-php-image/#findComment-1317006 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.