Hello
I do not know why but this code seems to work fine only in my xampp local insallation but not in the remote server. I just see a black square instead of the number 0000000 when I run this code in the remote server through the link http://www.arreglaordenador.com/numberimage.php
and the code in numberimage.php is:
Code: (text)
<?php
$fontDir = $rootPath . "fonts\";
$fn = (isset($_GET['fn'])) ? $_GET['fn'] : "ARIAL.ttf";
$fs = (isset($_GET['fs'])) ? $_GET['fs'] : 10;
$maxWidth = 80 * $fs;
//$colorArray = array ("red", "green", "blue", "cyan", "magenta", "yellow", "black", "white", "gray");
$colorArray = array ("black", "black", "black", "black", "black", "black", "black", "black", "black");
$color = (isset($_GET['color'])) ? $colorArray[$_GET['color']] : $colorArray[rand(0, 8)];
$txt = (isset($_GET['txt'])) ? $_GET['txt'] : "0000000";
$coords = imagettfbbox($fs, 0, $fontDir . $fn, $txt);
$w = abs($coords[4]) + 8;
$h = abs($coords[5]) + 8;
$img = imagecreatetruecolor($w, $h);
$red = imagecolorallocate($img, 255,0,0);
$green = imagecolorallocate($img, 0,255,0);
$blue = imagecolorallocate($img, 0,0,255);
$cyan = imagecolorallocate($img, 0,255,255);
$magenta = imagecolorallocate($img, 255,0,255);
$yellow = imagecolorallocate($img, 255,255,0);
$black = imagecolorallocate($img, 0,0,0);
$white = imagecolorallocate($img, 255,255,255);
$gray = imagecolorallocate($img, 127,127,127);
$fill = ($color == "white") ? $black : $white;
imagefill($img, 0, 0, $fill);
$position = 4;
if (isset($_GET['position'])) $position = $_GET['position'];
imagettftext($img, $fs, 0, 0, $h-$position, $$color, "$fontDir$fn", $txt);
header("content-type: image/jpeg");
imagejpeg($img, "", 100);
imagedestroy($img);
?>
Does any of you have any suggestion?
Thanks
constructor ?
i have written this program and made 3 constructors in the class and i want to call them in the main and i cant can any one help me and tell me how could i call them in the main
IS Retail & Manufacturing
Hi
Points for Wiki contribution
Hi everyone,
login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php index.php . Now if i will not give correct detail i can not see the index.php ,all working perfect
Problem writing URL into database
How would I write this into the database?<?php echo "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>I tried this:Code: $url =
form problem
below in the form action, i've put "test.php?w=$sw&h=$sh" but when i input the form i get this..test.php?search=example&submit=searchhow do i get all of this together in the
Reading Most Recent CSV File in Directory
I thought I had wrapped this project up, but found out that the program I use to FTP a csv file to my website is best used in time stamp mode. That is, each day a newly named csv file is uploaded with
A problem with my GD class
Hello,I created a nice (and simple for now) GD class.The problem is , it works great on wamp, but not in my hostgator acount ( Linux )i tried it on byethost and it didnt worked as well.I am posting
registration form
first time posting. did some searches but didnt find exactly what i am looking for. dont flame cause i am posting in the wrong area. I am starting from scratch with a new registration form for a
upload form file types....
Hey all, I am learning PHP and I am writing a script from the W3C Schools tutorials for uploading files to my server. I want to be able to use it for a friend to upload files to my server (I know to