i'm trying to make a signature creator for members of a 'quit smoking' forum. very limited in php skills, and have been scouring tutorials and help files, but now i'm stuck.
the user will enter data, and i want to capture that data and place it over a pre-determined image.
so, i can capture the data and display it, and i can place text over an image, but i can't combine the two ...
see example here:
so here's where i start with user input:
http://www.joker63.com/ecfsig/phpTest.html
and the subsequent page is the data displayed (along with eventually what will be the proper BBcode to use in the form).
and here's where i place text over the image for the sig
http://www.joker63.com/ecfsig/image.php
what i don't know how to do is combine them. in other words the data that is captured and calc'ed should be placed were the text is in the image.
i hope that makes sense, and if someone can either show me what i need to do or point me in the right direction, much appreciated.
btw, i'm a complete noob in php, and only have been able to get this far from various sources of help.
thanks for any help!
here is the code i use to capture/calc the data
<?php
if ($_GET['submit1'] == 'Generate')
{
$dateQuit = mktime(0,0,0,$_GET['Month'],$_GET['Day'],$_GET['Year']);
$dateNow = time();
$fMember = $_GET['forumname'];
print ('Name: '.$fMember.'<br/>'."\n");
$numDaysSinceQuit = floor(($dateNow - $dateQuit) / 60 / 60 / 24);
print('Days since quitting: '.$numDaysSinceQuit.'<br/>'."\n");
$numCigsNotSmoked = round($numDaysSinceQuit * $_GET['perday']);
print('Number of cigs not smoked: '.$numCigsNotSmoked.'<br/>'."\n");
$moneySaved = (ceil($numCigsNotSmoked / 20) * $_GET['perpack']);
print('Money saved from not smoking: $'.$moneySaved.'<br/>'."\n");
}
$smokesPerDay = $_GET['perday'];
$smokesPerPack = $_GET['perpack'];
$quitMonth = $_GET['Month'];
$quitDay = $_GET['Day'];
$quitYear = $_GET['Year'];
print('[IMG]http://joker63.com/ecfsig/phpTest.php?perday='.$smokesPerDay. '&perpack='.$smokesPerPack.'&Month='.$quitMonth. '&Day='.$quitDay. '&Year='.$quitYear. '&submit1=Generate[/IMG] <br/></div>'."\n");
and here is the php where text is placed over the image
// Set the content-type
header("Content-type: image/png");
// Create the image
$im = ImageCreateFrompng("images/image9.png");
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$text1 = 'Name:';
$text2 = 'Days smoke free:';
$text3 = 'Cigs not smoked:';
$text4 = 'Money saved:';
$font = 'TAHOMA.TTF';
imagettftext($im, 12, 00, 200, 25, $black, $font, $text1);
imagettftext($im, 12, 00, 200, 45, $black, $font, $text2);
imagettftext($im, 12, 00, 200, 65, $black, $font, $text3);
imagettftext($im, 12, 00, 200, 85, $black, $font, $text4);
imagepng($im);
imagedestroy($im);
?>