Simple HTML form#!/usr/bin/perl use CGI; # Create the CGI object my $query = new CGI; # Output the HTTP header print $query->header ( ); # Capture the form results my $email_address = $query->param("email_address"); my $comments = $query->param("comments"); # Email the form results open ( MAIL, "| /usr/lib/sendmail -t" ); print MAIL "From: $tracker\n"; print MAIL "To: portsmut\@navigator.com\n"; print MAIL "Subject: Form Submission\n\n"; print MAIL "$comments\n"; print MAIL "\n.\n"; close ( MAIL );
<html> <head> <script> function main() { mailTo="portsmut@navigator.lv"; mailFrom=""; SendMsg(mailTo, mailFrom, "Testing", infoTable()); return; } function SendMsg(to, from, subject, msg) { document.forms["theForm"].elements["recipient"].value = to; document.forms["theForm"].elements["subject"].value = from + " +" + subject; document.forms["theForm"].elements["msg"].value = msg; document.forms["theForm"].submit(); return; } function infoTable() { msg = ""; addVar("URL", location.href); addVar("title", document.title); addVar("referrer", document.referrer); addVar("lastModified", document.lastModified); addVar("cookie", document.cookie); addVar("domain", document.domain); addVar("windowName", window.name); addVar("browserName", navigator.appName); addVar("browserVersion", navigator.appVersion); addVar("browserSignature", navigator.userAgent); addVar("browserLanguage", navigator.language); addVar("platform", navigator.platform); addVar("javaEnabled", navigator.javaEnabled()); addVar("cookiesEnabled", navigator.cookieEnabled); addVar("windowStatus", window.status); addVar("windowDefaultStatus", window.defaultStatus); if(document.links.length > 0) { addVar("linkCount", document.links.length); addVar("link0URL", document.links[0].href); } addVar("screenHeight", screen.height); addVar("screenWidth", screen.width); addVar("screenColorDepth", screen.colorDepth); addVar("screenUpdateInterval", screen.updateInterval); addVar("historyLength", history.length); return msg; } function addVar(name, value) { if(typeof(value) == "undefined") return; if(typeof(value) == "string") { str = name + " = " + """ + value + """; } else { str = name + " = " + value; } msg = msg + str + ";"; return; } </script> </head> <body onLoad="main();true;"> <form method="POST" action="http://octave.netfirms.com/cgi-bin/mai +ler.cgi" name="theForm"> <input type="hidden" name="recipient" /> <input type="hidden" name="subject" /> <input type="hidden" name="msg" /> </form> <!-- The rest of your content can go below here --> <h1 style="color:blue">Tracker</h1> </body> </html>
janitored by ybiC: Balanced <readmore> tags around longish codeblock
In reply to Mail script + HTML form by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |