Text colour and stroke you mean.

Text colour and stroke you mean.
I get:
www.revisionarea.info/generator is the link...Code:<br /> <b>Fatal error</b>: Call to undefined function: imagettftext() in <b>/home/revision/public_html/generator/gen.php</b> on line <b>20</b><br />
And ahh ok NVM about the strokeIll try the colour bits when I get this working...
Index.php:
Gen.phpPHP Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
}
.style2 {font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;}
input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; }
select { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; }
-->
</style>
</head>
<body>
<p><span class="style1">Text Generator using fonts!
<br>
</span><span class="style2">Coded by <strong>***********.co.uk</strong></span><span class="style2"><br>
<br>
</span></p>
<form method="post" action="gen.php">
<div align="center" style="border: dashed 1px; background-color: #F7F7F7">
<p><span class="style1">Text:</span><br>
<input type="text" name="text">
<br />
<br />
<span class="style1">Font:</span><br>
<select name="font">
<option value="habbo" selected="selected">Habbo Original Font</option>
</select>
<br />
<br />
<input name="Submit" type="submit" class="style2" value="Submit"> </p>
</form>
<div align="center">
<p><span class="style2">Provided by </span><span class="style1">TFN::<em>TeeGen</em></span><em class="style2"> - </em><span class="style2">Created by<strong> ***********.co.uk ;) </strong><strong><br />
</strong></span></p>
</div>
</body>
</html>
PHP Code:<?php
// Set the content-type
header("Content-type: image/gif");
// Create the image
$im = imagecreatetruecolor(400, 30);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
// The text to draw
$text = $_POST['text'];
// Replace path by your own font path
$font = 'habbo.ttf';
// Add some shadow to the text
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
// Add the text
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
$rand = rand(0, 60000);
// Using imagepng() results in clearer text compared with imagejpeg()
imagegif($im,'$rand.gif');
imagedestroy($im);
?>
Im only just starting to learn PHP bit by bit so I am a complete noob![]()
Last edited by Recursion; 30-03-2007 at 08:31 PM.
You need the GD libary installed.
If you are on shared hosting then I SERIOUSLY recommend you move hosts as the GD libary is standard.
Ahh ok, I didn't think Speed-networks had GD -.-
on 1and1 it just comes up with a blank page...
On Eclipse.co.uk hosting it just comes up withCode:The Image cannot be displayed because it contains errors
Last edited by Recursion; 30-03-2007 at 08:39 PM.
1and1 suck to start with, they probs aint even heard of GD.
Drop me a PM with the script and ill test it on my server (GD is fully working, check out my msn sig ^^)
Want to hide these adverts? Register an account for free!