Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi there i'm trying to make a php file which returns an image for use in a website. The php file takes a string from the call and explodes it char's then uses an image for each char and returns the whol thing to the img tag. what excatly do i return so that it works?
example of it in use..Code: Select all
<img src="images/text_bar/image.php?text=hello">Code: Select all
<?php {
$text = $_GET['text'];
$mode = $_GET['mode'];
$text_l = strlen($text);
$seperator_count = $text_l - 1;
$str_position = 0;
$char_array = str_split($text,1);
//Start loop to print out image
while ($text_l > $str_position && $mode == '') {
$current_char = $char_array[$str_position];
$output = $output . '<img src="' . $current_char . '.gif" border="0">';
if ($seperator_count > 0) {
$output = $output . '<img src="seperator.gif" border="0">';
$seperator_count--;
}
$str_position ++;
}
//Alternate color printout
while ($text_l > $str_position && $mode == 'b') {
$current_char = $char_array[$str_position];
$output = $output . '<img src="' . $current_char . '_b.gif" border="0">';
if ($seperator_count > 0) {
$output = $output . '<img src="seperator.gif" border="0">';
$seperator_count--;
}
$str_position ++;
}
//return/output $ouput?
} ?>feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]