OK - the form is just a single field, a textarea field.
I type in multiple lines, seperated by :: (for now)
Here is the code that is troublesome in the target script:
my $text = $query->param("text");
make_image($text);
exit(0);
##########################################################
# Make an image from the lines in the array
#
sub make_image {
my $text = shift;
my @lines = split(/\n/,$text);
my $counter = 80;
foreach my $line (@lines) {
$im->stringTTF($black, "/home/httpd/html/ribbon.ttf", 15, 0, 5
+0, 80,$line);
if ($@) {
$im->string(gdSmallFont, 50, 150, "$@", $black);
die "Cannot print!$!\n";
}
$counter += 10;
}
binmode STDOUT;
print $query->header(-type=>'image/png');
print $im->png;
}
This code has been altered a million times, so if you find some syntax error, it's probably something I haven't fixed from the last edit ;-)
Anyhow, if I hit http://localhost/myscript.pl?text=I+LOVE+MY+WIFE then it works. Going through a web form which then writes <img src="/myscript.pl?$text"> ($text being pulled by $text = $q->param("text") ) then it only prints the first letter, the I.
My goal here is to eventually make a script that people can type in their text, the thing makes a multi-line image from it with that nice ribbon font, and the result gets sent as a kind of greeting card/invitation (for weddings, child birth announcements, etc).
Any help would be appreciated.
What does this little button do . .<Click>;
"USER HAS SIGNED OFF FOR THE DAY"
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.