...
oh my, thanks.. i feel like a total newbie, now. thanks much
now while on the subject, the image now works, using that image created by php, is there a way to keep that image but replace the text inside it, without editing the code.. like a smaller buttons... using a function, like button('Sale'); or button('Sale last week');
What i am trying to do, is make buttons for a website, i'm working on, and instead of putting more space on the server i want php to make the buttons for me on the site
button('Home','index.php');
button('News','news.php');
ect
but still using the same button (button.php thats is blank adding the text to it with a fuction in the main index.php..
button.php:
<?
$im = imagecreatefrompng('Button.png');
$blue = ImageColorAllocate($im, 14,1,175);
$color=$blue;
$width=ImageSX($im);
$height=ImageSY($im);
$font_size=15;
putenv('GDFONTPATH=C:\Windows\Fonts');
$fontname='arial';
if(isset($text)){
ImageTTFText ($im,$font_size,0,50,22,$blue,$fontname,$text);
}
Header('Content-type: image/png');
ImagePng($im);
ImageDestroy($im);
?>
Index.php:
<?
function button($string)
{
$text=$string;
echo "<img src=button.php><br>";
}
button('Home');
button('News');
?>
not linking anything yet just testing it as you can tell.. and the image/button comes up blank...
hope i made that next problem as clear as possible