Jump to content

[SOLVED] Captcha Image Pixelated


whiteboikyle

Recommended Posts

I have an image that auto add's info to.. Before it add's info the image is fine.. but after using PHP it gets really pixelted

 

Captcah.php

<?php
require("config.php");
$name = $_GET['name'];
if($name == "")
{
die();
}
else
{
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$query = "SELECT * FROM btcs3_members where username = '".$name."'";
$result = mysql_query($query);
for ($i = 0; $i < mysql_num_rows($result); $i = $i + 1)
{
	$aim = mysql_result($result, $i, "aim");
	$rank = mysql_result($result, $i, "rank");
	$user = mysql_result($result, $i, "username");
	$maingame = mysql_result($result, $i, "maingame");
	$inactive = mysql_result($result, $i, "inactive");
	$disable = mysql_result($result, $i, "disable");
	$medals = mysql_result($result, $i, "medals");
	$datejoined = mysql_result($result, $i, "datejoined");
	$recruits = mysql_result($result, $i, "recruits");
}
//Days In Clan
$days = round((time() - $datejoined)/86400);


if($disable == "1") {
$active = "DISABLED"; 
} else {
if($inactive = "0"){
$active = "IA";
} else {
$active = "Active";
}
}
$medals = count($medals);	
if($rank == "31")
{
$rank = "Commander";
}
if($maingame == "5")
{
$maingame = "Counter-Strike 1.6";
}
session_start();
$im = imagecreatefrompng ("image/image.png");
$color = imagecolorallocate($im, 1, 1, 1);
$text = "Name: ";
$font = 'arial.ttf';
$size = 10;

//Active
imagettftext($im, $size, 0, 420, 89, $color, $font, $active);
//Medals
imagettftext($im, $size, 0, 425, 31, $color, $font, $medals);
//MainGame
imagettftext($im, $size, 0, 258, 89, $color, $font, $maingame);
//rank
imagettftext($im, $size, 0, 228, 60, $color, $font, $rank);
//Days In Clan
imagettftext($im, $size, 0, 455, 60, $color, $font, $days);
//Name
imagettftext($im, $size, 0, 228, 31, $color, $font, $user);
//aim
imagettftext($im, $size, 0, 215, 118, $color, $font, $aim);
//Recruits
imagettftext($im, $size, 0, 431, 118, $color, $font, $recruits);

header('Content-type: image/png');
imagejpeg($im);
imagedestroy($im);
}
?> 

 

Config

<?php

$host="BLOCKED FOR SECURE"; // Host name
$username="BLOCKED FOR SECURE"; // Mysql username
$password="BLOCKED FOR SECURE"; // Mysql password
$db_name="BLOCKED FOR SECURE"; // Database name

?>

 

Here is the LocalHost Output

1212400928.png

 

Here is the Hosting Output:

]http://scripts.corpaluploads.com/gd/captcha.php?name=Yakuza[Ki]

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.