Click to See Complete Forum and Search --> : image command in perl form script
Mr.Mike
09-07-2003, 11:59 AM
Gentelmen..
this is probably going to be a very simple one for you all.
How do you get an image (logo) to show up on the thank you page after the forms been submited (like below).
I'm really working with one of matts forms and its much the same as this from goodies, but his is alot longer.
this has all the same commands ... print..print.. print..
So can some body tell me whats the perl command to show an image in this page below?
Regards,
Mike
---------------------------
sub thank_you {
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>Thank You!</TITLE>\n";
print "</HEAD>\n";
print "<BODY BGCOLOR=#FFFFCC TEXT=#000000>\n";
print "<H1>Thank You!</H1>\n";
print "\n";
print "<P>\n";
print "<H3>Your feedback is appreciated.<BR>\n";
print "<P>\n";
print "</BODY>\n";
print "</HTML>\n";
exit(0);
}
sub thank_you {
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>Thank You!</TITLE>\n";
print "</HEAD>\n";
print "<BODY BGCOLOR=#FFFFCC TEXT=#000000>\n";
print "<H1>Thank You!</H1>\n";
print "\n";
print "<P>\n";
print "<H3>Your feedback is appreciated.<BR>\n";
print "<P>\n";
print "<p>\n";
print "<img src=\"http://mysite.com/myimage.gif\">\n";
print "</p>\n";
print "</BODY>\n";
print "</HTML>\n";
exit(0);
}
...I might also add that you add the alt tag to your image like so:
alt=\"myalt text\" escaping the double quotes, again
or use single quotes...
sub thank_you {
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>Thank You!</TITLE>\n";
print "</HEAD>\n";
print "<BODY BGCOLOR=#FFFFCC TEXT=#000000>\n";
print "<H1>Thank You!</H1>\n";
print "\n";
print "<P>\n";
print "<H3>Your feedback is appreciated.<BR>\n";
print "<P>\n";
print "<p>\n";
print "<img src='http://mysite.com/myimage.gif'>\n";
print "</p>\n";
print "</BODY>\n";
print "</HTML>\n";
exit(0);
}
alt='myalt text'
Mr.Mike
09-07-2003, 04:26 PM
So your saying like so then ?
print "<img src=\"http://mysite.com/myimage.gif\" alt=\"myalt text\">\n";
seems to be a problem with it finding the image in the cgi-bin folder same place the formmail.pl is?
Doesn't find it :
print "<img src=\"http://mysite.com/cgi-bin/bcc_logo_300.gif\">\n";
Finds the image but its not in secure area and you get the pop up alert:
print "<img src=\"http://mysite.com/Bcc_Page_files/bcc_logo_300.gif\">\n";
and if we wanted to make it a link also... ???
how do you leave breaks "<br>" with this code?
Please let me know.
Mike
...depending on your server configuration, generally, images located in the cgi-bin are sometimes treated just like a script, therefore, unless you have control over the configuration, it is best to call them from a directory outside the bin...
secure area??
print "<a href='http://mysite.com/somewhere.html'>";
print "<img src='http://mysite.com/myimage.gif'";
print " alt='myalttext'></a>";
print"<br><br><br>";
or
print "<a href=\"http://mysite.com/somewhere.html\">";
print "<img src=\"http://mysite.com/myimage.gif\"";
print " alt=\"myalttext\"></a>";
Mr.Mike
09-08-2003, 10:41 AM
Thank you very much for your help Cyco.
Now all i have to do now is figure out how to make this form script work without puttting my email address in the form part of the whole ordeal.
I don't even see why its needed in the form part it has the info of which domain its to be used on in the script part:
@referers = ('scriptarchive.com','YOUR_IP');
and also the email address to who its to be sent to also
@recipients = ('^yourself\@yourdomain\.com');
I just don't get this required
<input type=hidden name="recipient" value="email@your.host.com">
needed in the form part and how to get around it??
Regards,
Mike :( :confused:
Mr.Mike
09-09-2003, 09:03 AM
here it is: