<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CGI e Perl per una mailform]]></title><description><![CDATA[<p dir="auto">Ho su questa <a href="http://www.hcaldana.com/modulo.htm" rel="nofollow ugc">pagina</a> un form per richieste, il mailform è su di un'altro host di un altro mio sito, il problema è che quando invio i dati mi rimanda questo messaggio...</p>
<p dir="auto">%1 is not a valid Win32 application.</p>
<p dir="auto">Che é?</p>
<p dir="auto">vi post anche il file mailform.cgi è un pò lunghetto :):</p>
<blockquote class="spoiler border border-warning"><button class="btn btn-sm btn-ghost border">Spoiler</button><p class="d-none mt-3 text-sm">/usr/local/bin/perl</p>
<h1></h1>
<p dir="auto">######################################################################</p>
<h1>A&amp;M MailForm        Version 1.2</h1>
<h1>Copyright            1999 Alex Iatskovski <a href="mailto:74642.3600@compuserve.com" rel="nofollow ugc">74642.3600@compuserve.com</a></h1>
<h1>Created              06/10/99</h1>
<h1>Last Modified        06/15/99</h1>
<h1>Home URL           <a href="http://www.anmweb.com" rel="nofollow ugc">http://www.anmweb.com</a></h1>
<h1></h1>
<p dir="auto">######################################################################</p>
<h1></h1>
<h1>This is a MailForm program that allows you to communicate with the</h1>
<h1>visitors of your home page without publishing your E-mail address on</h1>
<h1>the Web. Your real E-mail address is completely hidden from spammers</h1>
<h1>(it is not shown in web-page source in contrast to most such programs),</h1>
<h1>but at the same time you are not losing ability to communicate with</h1>
<h1>a civilized visitors of your Web Site.  This program is using Java Script</h1>
<h1>to display form in a nice popup window. But it works as well if Java Script</h1>
<h1>is disabled in visitor's browser. It will work with all known Web Browsers.</h1>
<h1>No more HTML forms programming! This script is generating all necessary</h1>
<h1>forms dynamically on the fly.</h1>
<h1></h1>
<p dir="auto">######################################################################</p>
<h1></h1>
<h1>Installation:</h1>
<h1></h1>
<h1>Put this script into your cgi-bin directory and make it executable</h1>
<h1>(chmod 755 on most system). Then change variables according to your</h1>
<h1>requirements.</h1>
<h1></h1>
<h1>1. Make sure the very top line of script is pointed to the exact location</h1>
<h1>of Perl program on your server.</h1>
<h1></h1>
<h1>2. Make sure the "$mailprog" variable is pointed to the exact location of</h1>
<h1>"sendmail" program on your server.</h1>
<h1></h1>
<h1>3. Make sure to change "$admin_mail" variable to your real E-mal address.</h1>
<h1></h1>
<h1>4. Make sure the "$cgiurl" variable is pointed to the exact URL of</h1>
<h1>your script.</h1>
<h1></h1>
<h1>To call this program from the Web pages use something like this:</h1>
<h1></h1>
<h1>----------Cut here----------</h1>
<h1>&lt;a href="/cgi-bin/mailform.cgi" target="NewWindow"</h1>
<h1>onclick="window.open('/cgi-bin/mailform.cgi','newWindow','toolbar=0,</h1>
<h1>location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,</h1>
<h1>width=500,height=420');return false"&gt;&lt;strong&gt;Contact Us&lt;/strong&gt;&lt;/a&gt;</h1>
<h1>----------End of cut----------</h1>
<h1></h1>
<h1>IMPORTANT! This whole HTML link should be written in ONE LINE! Otherwise</h1>
<h1>the Java Script will not work. Make sure also that the "/cgi-bin/mailform.cgi"</h1>
<h1>part is pointed to the real location of the script. If not, you should change</h1>
<h1>it (two times!) in above example and put it to your HTML page.This construction</h1>
<h1>will work even with Java Script disabled browsers.</h1>
<h1></h1>
<h1>That's all! Your program is now up and running.</h1>
<h1></h1>
<p dir="auto">######################################################################</p>
<h1></h1>
<h1>COPYRIGHT NOTICE</h1>
<h1>(c)Copyright 1999 Alex Iatskovski All Rights Reserved.</h1>
<h1></h1>
<h1>A&amp;M Register program is FREEWARE BUT IT IS NOT PUBLIC DOMAIN! This</h1>
<h1>program may be used free of charge by anyone so long as this copyright</h1>
<h1>notice and the comments above remain intact. Any modification to this</h1>
<h1>program except configuration user variables is strictly prohibited!</h1>
<h1>By using this code you agree to indemnify A.Iatskovski from any liability</h1>
<h1>that might arise from its use.</h1>
<h1></h1>
<h1>Selling the code for this program without prior written consent</h1>
<h1>is expressly forbidden. In other words, please ask first before</h1>
<h1>you try and make money off of my program.</h1>
<h1></h1>
<h1>Obtain permission before redistributing this software over the</h1>
<h1>Internet or in any other medium. In all cases copyright and header</h1>
<h1>must remain intact.</h1>
<h1></h1>
<p dir="auto">######################################################################</p>
<h1>Perl's use strict directive checks to make sure variables are</h1>
<h1>declared before use. It's a handy check to make sure you are doing</h1>
<h1>what you think you are doing. Always</h1>
<p dir="auto">use strict;</p>
<h1>Make sure your Perl version is not earlier than this one</h1>
<p dir="auto">require 5.003;</p>
<p dir="auto">######################################################################</p>
<h1>Define Variables</h1>
<h1>Mail program path</h1>
<p dir="auto">my ($mailprog) = '/usr/sbin/sendmail';</p>
<h1>Admin E-mail</h1>
<p dir="auto">my ($admin_mail) = 'hcaldana@ivg.it';</p>
<h1>CGI URL</h1>
<p dir="auto">my ($cgiurl) = '<a href="http://www.hotelvillamarina.eu/cgi-bin/mailform.cgi" rel="nofollow ugc">http://www.hotelvillamarina.eu/cgi-bin/mailform.cgi</a>';</p>
<h1>Global Vars, don't change!</h1>
<p dir="auto">my ($buffer, @pairs, $pair, $name, $value, %FORM);</p>
<h1>Done</h1>
<p dir="auto">######################################################################</p>
<p dir="auto">###################################</p>
<h3>Do not edit below this line</h3>
<p dir="auto">###################################</p>
<h1>Antihacker's rooting</h1>
<p dir="auto">if ($ENV{'QUERY_STRING'} ne '') {<br />
my ($text) = &lt;&lt;EOT;<br />
To be a hacker indicates to be a man with more than just one cerebral bend.<br />
What do you attempt to do here boy? These tries do not roll on this server!<br />
If you have something to say - speak up, if not - get lost and say your mother<br />
that your stupid attempt to hack this Web Site was logged by server's security staff.<br />
EOT<br />
&amp;error($text);<br />
}<br />
else {<br />
&amp;parse_form();<br />
}</p>
<p dir="auto">if ($FORM{'action'} eq 'send_form') {<br />
&amp;check_form();<br />
&amp;mail_form();<br />
&amp;show_thanks();<br />
}<br />
else {<br />
&amp;main_form();<br />
}</p>
<p dir="auto">###############<br />
sub parse_form {<br />
###############<br />
# Read in text<br />
$ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;<br />
if ($ENV{'REQUEST_METHOD'} eq "POST"){<br />
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});<br />
}<br />
else {<br />
$buffer = $ENV{'QUERY_STRING'};<br />
}<br />
# Split information into name/value pairs<br />
@pairs = split(/&amp;/, $buffer);<br />
foreach $pair (@pairs){<br />
($name, $value) = split(/=/, $pair);<br />
$value =~ tr/+/ /;<br />
$value =~ s/%(..)/pack("C", hex($1))/eg;<br />
$FORM{$name} = $value;<br />
}<br />
}</p>
<p dir="auto">##############<br />
sub main_form {<br />
##############<br />
my $title = 'Contact Us';<br />
my $text = &lt;&lt;EOF;<br />
&lt;FORM ACTION="$cgiurl" METHOD="POST"&gt;<br />
&lt;INPUT TYPE="text" SIZE="30" NAME="nome" VALUE="Nome" MAXLENGTH="30"&gt;<br />
&lt;BR&gt;&lt;BR&gt;<br />
&lt;INPUT TYPE="text" SIZE="30" NAME="cognome" VALUE="Cognome" MAXLENGTH="30"&gt;<br />
&lt;BR&gt;&lt;BR&gt;<br />
&lt;INPUT TYPE="text" SIZE="30" NAME="email" VALUE="Your E-mail" MAXLENGTH="30"&gt;<br />
&lt;BR&gt;&lt;BR&gt;<br />
&lt;INPUT TYPE="text" SIZE="30" NAME="via" VALUE="via" MAXLENGTH="30"&gt;<br />
&lt;BR&gt;&lt;BR&gt;<br />
&lt;INPUT TYPE="text" SIZE="30" NAME="cap" VALUE="CAP" MAXLENGTH="30"&gt;<br />
&lt;BR&gt;&lt;BR&gt;<br />
&lt;INPUT TYPE="text" SIZE="30" NAME="città" VALUE="città" MAXLENGTH="30"&gt;<br />
&lt;BR&gt;&lt;BR&gt;<br />
&lt;INPUT TYPE="text" SIZE="30" NAME="provincia" VALUE="provincia" MAXLENGTH="30"&gt;<br />
&lt;BR&gt;&lt;BR&gt;<br />
&lt;INPUT TYPE="text" SIZE="30" NAME="stato" VALUE="stato" MAXLENGTH="30"&gt;<br />
&lt;BR&gt;&lt;BR&gt;<br />
&lt;TEXTAREA NAME="richiesta" ROWS="5" COLS="50"&gt;Type your text here&lt;/TEXTAREA&gt;<br />
&lt;BR&gt;&lt;BR&gt;<br />
&lt;select name="Per quale albergo?"&gt;<br />
&lt;option value="Tutti e tre" selected&gt;Tutti e tre&lt;/option&gt;<br />
&lt;option value="Hotel Villa Marina"&gt;Hotel Villa Marina&lt;/option&gt;<br />
&lt;option value="Hotel Nuovo Bristol"&gt;Hotel Nuovo Bristol&lt;/option&gt;<br />
&lt;option value="Hotel Corallo"&gt;Hote Corallo&lt;/option&gt;<br />
&lt;/select&gt;&lt;br&gt;&lt;br&gt;<br />
&lt;select name="come ci hai trovato"&gt;<br />
&lt;option value="amici e/o parenti" selected&gt;amici e/o parenti&lt;/option&gt;<br />
&lt;option value="motori di ricerca"&gt;motori di ricerca&lt;/option&gt;<br />
&lt;option value="opuscoli pubblicitari"&gt;opuscoli pubblicitari&lt;/option&gt;<br />
&lt;option value="portali turistici e non"&gt;portali turistici e non&lt;/option&gt;<br />
&lt;/select&gt;&lt;br&gt;&lt;br&gt;<br />
&lt;INPUT TYPE="submit" NAME="submit" VALUE="Send Comments"&gt; <br />
&lt;INPUT TYPE="reset" NAME="Button" VALUE="Clear Comments"&gt;<br />
&lt;input type=hidden name="action" value="send_form"&gt;<br />
&lt;/FORM&gt;<br />
EOF<br />
&amp;show_form($title,$text);<br />
}</p>
<p dir="auto">###############<br />
sub check_form {<br />
###############<br />
if($FORM{'realname'} eq "Your name"){<br />
&amp;error('You forgot to enter your name!');<br />
}<br />
elsif($FORM{'realname'} eq ""){<br />
&amp;error('You forgot to enter your name!');<br />
}<br />
elsif(!($FORM{'email'} =~ /([\w-.]+@[\w-.]+)/)){<br />
&amp;error('You forgot to enter your E-mail address!');<br />
}<br />
elsif($FORM{'subject'} eq "Subject"){<br />
&amp;error('You forgot to enter a Subject!');<br />
}<br />
elsif($FORM{'subject'} eq ""){<br />
&amp;error('You forgot to enter a Subject!');<br />
}<br />
elsif($FORM{'body'} eq "Type your text here"){<br />
&amp;error('You forgot to write a message!');<br />
}<br />
elsif($FORM{'body'} eq ""){<br />
&amp;error('You forgot to write a message!');<br />
}<br />
}</p>
<p dir="auto">##############<br />
sub mail_form {<br />
##############<br />
my $text = &lt;&lt;EOF;<br />
Administrator of this server forgot to enter his E-mail<br />
address to this program! I can't continue without correct<br />
E-mail address of the site administrator.<br />
EOF<br />
if ($admin_mail eq 'yourname@yourhost.com'){&amp;error($text);}<br />
open(MAIL,"|$mailprog -t");<br />
print MAIL "To: $admin_mail\n";<br />
print MAIL "From: $FORM{'email'} ($FORM{'realname'})\n";<br />
print MAIL "Subject: $FORM{'subject'}\n";<br />
print MAIL "X-Priority: 1 (Highest)\n\n";<br />
print MAIL "#\n";<br />
print MAIL "# Entered from $ENV{'REMOTE_HOST'} ($ENV{'REMOTE_ADDR'}) with $ENV{'SERVER_PROTOCOL'}.\n";<br />
print MAIL "#\n\n";<br />
print MAIL "$FORM{'body'}\n";<br />
close(MAIL);<br />
}</p>
<p dir="auto">################<br />
sub show_thanks {<br />
################<br />
my $title = 'Form Input Accepted';<br />
my $text = &lt;&lt;EOF;<br />
&lt;small&gt;Your form details have been sent.&lt;/small&gt;&lt;br&gt;<br />
&lt;h1&gt;&lt;b&gt;Thank you!&lt;/b&gt;&lt;/h1&gt;<br />
EOF<br />
&amp;show_form($title,$text);<br />
}</p>
<p dir="auto">###################################</p>
<h1>Sub Error</h1>
<h1>Usage - &amp;error('Your text here');</h1>
<p dir="auto">###################################<br />
sub error {<br />
my $title = 'Error';<br />
my $text1 = $_[0];<br />
my $text = &lt;&lt;EOF;<br />
&lt;small&gt;The program could not complete your request. This was because:&lt;/small&gt;<br />
&lt;br&gt;&lt;br&gt;<br />
&lt;small&gt;&lt;b&gt;$text1&lt;/b&gt;&lt;/small&gt;&lt;br&gt;&lt;br&gt;<br />
&lt;small&gt;Click &lt;a href="$cgiurl"&gt;&lt;font color="<a href="/hashtags/0000ff">#0000FF</a>"&gt;here&lt;/font&gt;&lt;/a&gt; to<br />
start over, otherwise close this window.&lt;/small&gt;<br />
EOF<br />
&amp;show_form($title,$text);<br />
}</p>
<p dir="auto">###################################</p>
<h1>Sub main_form</h1>
<h1>Usage - &amp;show_form($title,$text);</h1>
<p dir="auto">###################################<br />
sub show_form {<br />
print "Content-type:text/html\n\n";<br />
print "&lt;html&gt;\n";<br />
print "&lt;head&gt;\n";<br />
print "&lt;meta http-equiv="Content-Type" content="text/html;\n";<br />
print "charset=iso-8859-1"&gt;\n";<br />
print "&lt;meta name="robots" content="noindex"&gt;\n";<br />
print "&lt;title&gt;$<em>[0]&lt;/title&gt;\n";<br />
print "&lt;/head&gt;\n";<br />
print "&lt;body bgcolor="<a href="/hashtags/ffffff">#FFFFFF</a>"&gt;\n";<br />
print "&lt;div align="center"&gt;\n";<br />
print "&lt;table border="0" cellpadding="0" cellspacing="0" width="100%"\n";<br />
print "bgcolor="<a href="/hashtags/ffffff">#FFFFFF</a>"&gt;\n";<br />
print "&lt;tr&gt;&lt;th align="left" colspan="3" width="100%" bgcolor="#000080"\n";<br />
print "nowrap&gt;\n";<br />
print "&lt;font color="<a href="/hashtags/ffffff">#FFFFFF</a>" size="6"&gt;\n";<br />
print "&amp;nbsp;$</em>[0]\n";<br />
print "&lt;/font&gt;\n";<br />
print "&lt;/th&gt;\n";<br />
print "&lt;/tr&gt;\n";<br />
print "&lt;tr&gt;\n";<br />
print "&lt;td width="10%"&gt;&amp;nbsp;&lt;/td&gt;\n";<br />
print "&lt;td width="80%"&gt;&amp;nbsp;&lt;/td&gt;\n";<br />
print "&lt;td width="10%"&gt;&amp;nbsp;&lt;/td&gt;\n";<br />
print "&lt;/tr&gt;\n";<br />
print "&lt;tr&gt;\n";<br />
print "&lt;td width="10%"&gt;&amp;nbsp;&lt;/td&gt;\n";<br />
print "&lt;td width="80%"&gt;$_[1]&lt;/td&gt;\n";<br />
print "&lt;td width="10%"&gt;&amp;nbsp;&lt;/td&gt;\n";<br />
print "&lt;/tr&gt;\n";<br />
print "&lt;tr&gt;\n";<br />
print "&lt;td width="10%"&gt;&amp;nbsp;&lt;/td&gt;\n";<br />
print "&lt;td width="80%"&gt;&amp;nbsp;&lt;/td&gt;\n";<br />
print "&lt;td width="10%"&gt;&amp;nbsp;&lt;/td&gt;\n";<br />
print "&lt;/tr&gt;\n";<br />
print "&lt;tr&gt;\n";<br />
print "&lt;th align="right" colspan="3" width="100%" bgcolor="#000080"\n";<br />
print "nowrap&gt;\n";<br />
print "&lt;a href="<a href="http://www.anmweb.com/programs/%5C" rel="nofollow ugc">http://www.anmweb.com/programs/\</a>" target="top"&gt;\n";<br />
print "&lt;small&gt;&lt;font color="<a href="/hashtags/ffcc33">#FFCC33</a>"&gt;\n";<br />
print "A&amp;amp;M MailForm Ver.1.2\n";<br />
print "&lt;/font&gt;&lt;/small&gt;&lt;/a&gt;&amp;nbsp;\n";<br />
print "&lt;/th&gt;\n";<br />
print "&lt;/tr&gt;\n";<br />
print "&lt;/table&gt;\n";<br />
print "&lt;/div&gt;\n";<br />
print "&lt;br /&gt;&lt;div style="z-index:3" class="smallfont" align="center"&gt;SEO by &lt;a rel="nofollow" href="<a href="http://www.crawlability.com/vbseo/" rel="nofollow ugc">http://www.crawlability.com/vbseo/</a>"&gt;vBSEO&lt;/a&gt; 3.0.0 RC3&lt;/div&gt;&lt;br /&gt;&lt;div style="z-index:3" class="smallfont" align="center"&gt;SEO by &lt;a rel="nofollow" href="<a href="http://www.crawlability.com/vbseo/" rel="nofollow ugc">http://www.crawlability.com/vbseo/</a>"&gt;vBSEO&lt;/a&gt; 3.0.0 RC3&lt;/div&gt;&lt;br /&gt;&lt;div style="z-index:3" class="smallfont" align="center"&gt;SEO by &lt;a rel="nofollow" href="<a href="http://www.crawlability.com/vbseo/" rel="nofollow ugc">http://www.crawlability.com/vbseo/</a>"&gt;vBSEO&lt;/a&gt; 3.0.0 RC3&lt;/div&gt;&lt;br /&gt;&lt;div style="z-index:3" class="smallfont" align="center"&gt;SEO by &lt;a rel="nofollow" href="<a href="http://www.crawlability.com/vbseo/" rel="nofollow ugc">http://www.crawlability.com/vbseo/</a>"&gt;vBSEO&lt;/a&gt; 3.0.0 RC3&lt;/div&gt;&lt;/body&gt;\n";<br />
print "&lt;/html&gt;\n";<br />
exit (0);<br />
}</p>
<p dir="auto">#####################</p>
<h3>END OF SCRIPT</h3>
<p dir="auto">#####################</p></blockquote>
]]></description><link>https://dev.connect.gt/topic/19218/cgi-e-perl-per-una-mailform</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Dec 2026 20:29:14 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/19218.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Oct 2006 14:44:38 GMT</pubDate><ttl>60</ttl></channel></rss>