Hello. Here I am again. Im trying to rewrite the script
so it will let the user choose wich color the text should
get form a drop down menu, but I cant get this to work.
Would really apreciate some help on this.
Below is the script so far.
<?php
if(!empty($_POST)) {
$string = escapeshellcmd($_POST['string']);
$color = escapeshellcmd($_POST['color']);
$im = imagecreate (400, 50);
$bg = imagecolorallocate ( $im, 0, 0, 0 );
$tc = imagecolorallocate ( $im, $color, $color, $color);
imagefilledrectangle ( $im, 0, 0, 600, 300, $bg );
imagestring ( $im, 10, 30, 10, $string, $tc );
header ( 'Content-Type: image/png' );
imagepng ( $im );
imagedestroy ( $im );
}
else {
echo "<form method=post action=" . $_SERVER['PHP_SELF'] . ">";
echo "<br>Write in some text : ";
echo "<input type=text name=string><br>";
echo "Choose color: ";
echo "<select name=tc>";
echo "<option value='255,0,0'>Red</option>";
echo "<option value='0,0,255'>Blue</option>";
echo "<option value='0,255,0'>Green</option>";
echo "</select><br>";
echo "<input type=submit value=submit><br>";
echo "</form>";
}
?>