Hallo Leute habe folgendes problem
habe diesen code hier für eine button erstellung.
nur leider kommt immer dieser fehler hier
habe diesen code hier für eine button erstellung.
PHP-Code:
// button.php
<?
Header("Content-Type: image/gif");
// set up image and colours
$im = ImageCreateFromGif("button.gif");
$white = ImageColorAllocate($im, 255, 255, 255);
// get font dimensiona
$font_height = ImageFontHeight(3);
$font_width = ImageFontWidth(3);
// get image dimensiona
$image_height = ImageSY($im);
$image_width = ImageSX($im);
// get string length
$length = $font_width * strlen($channel);
// calculate start coordinates for string
$image_center_x = ($image_width/2)-($length/2);
$image_center_y = ($image_height/2)-($font_height/2);
// write string
ImageString($im, 3, $image_center_x, $image_center_y, $channel, $white);
// output to browser
Imagegif($im);
// data for menu items
// typically this data comes from a database
// an array is used here for simplicity
?>
// button.php ende
// index.php
<?
include("button.php");
$menu_items = Array();
$menu_items[0] = "Home";
$menu_items[1] = "Web Links";
$menu_items[2] = "Impressum";
$menu_items[3] = "Downloads";
$menu_items[4] = "Kontakt";
$menu_items[5] = "Gallerie";
?>
<center><h2>Pick A Channel</h2></center>
<table border=0>
<?
// loop for each item in array
foreach($menu_items as $channel)
{
// and print table row
?>
<tr>
<td>
<a href="#"><img src="index.php?channel=<? echo $channel; ?>"
border=0></a>
</td>
</tr>
<?
}
?>
</table>
Kommentar