i'm trying to run a perl script that suppost to grab email input from html page on my CentOS 5 machine. But it doesn't seem to run.
Here's the perl codeHare's the html codeCode:#! /usr/bin/perl # Simple Form Parser # Nothing Special :) # # 2008 - Mike Golvach - eggi@comcast.net # # Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License # print "Content-type: text/html\n\n"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $form{$name} = $value; } chop($today=`date '+%m/%d/%Y'`); $email_file_name = ">>/home/umarzuki/Desktop/emails.txt"; open (EMAILFILE,$email_file_name); print EMAILFILE $today,"",$form{'email'},"","\n"; close(EMAILFILE); $html_dir="/directory/where/your/thank/you/html/page/is"; $fname = "$html_dir/thanks_for_your_submission.html"; open (OFILE,$fname) ; while(<OFILE>) { s/##(\w+)#/$form{$1}/g; print $_; } close(OFILE);What should I do? I already chown'd it to apache userCode:</d> <title>XYZ - TEMPORARY SITE MAINTENANCE</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META HTTP-EQUIV="pragma" CONTENT="no-cache"> </head> <body bgcolor="003366"> <!-- 2008 - Mike Golvach - eggi@comcast.net --> <!-- Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td rowspan="2" height="47" width="15%"> <p> </p> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5%"> </td> <td width="5%"> </td> <td> </td> </tr> <tr> <td width="5%"> </td> <td width="5%"> </td> <td> </td> </tr> <tr> <td width="5%"> </td> <td width="5%"> </td> <td> </tr> <tr> <td width="5%"> </td> <td width="5%"> </td> <td> </td> <tr> <td width="5%"> </td> <td width="5%"> </td> <td> </td> </tr> </table> <td width="1%" height="51" > </td> <td width="79%" height="51"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="2%"> </td> <td width="98%"> <table border="0" cellspacing="0" cellpadding="0" width="545"> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </td> </tr> <td bgcolor="#FFFFFF" width="2%"> </td> <td width="97%" bgcolor="#FFFFFF" valign=bottom> </td> </tr> <tr> <td bgcolor="#FFFFFF" width="2%"> </td> <td width="97%" bgcolor="#FFFFFF" height="22" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="92%" valign="top" height="1"> </td> <td width="8%" height="1"> </td> </tr> <tr> <td valign="top"> <p>We regret that our site is down for temporary maintenance. As soon as our work is complete the site will be available immediately. We apologize for the inconvenience!</p> <p>Please enter your email address and we will contact you as soon as our site becomes available!</p><p> </p> <form ACTION="cgi-bin/formparser.pl" METHOD="POST"> <table border="0" width="100%"> <tr> <td align="right" width="30%"><font size="2" FACE="arial, helvetica, geneva"><b>E-mail Address:</b></font><br><font size="1" FACE="arial, helvetica, geneva">(e.g. bobby.joe@host.com)</font></td> <td align="left" width="40%"> <input NAME="email" TYPE="TEXT" SIZE="30"></td> <td width="30%" valign="middle" align="left"><font FACE="arial, helvetica, geneva" SIZE="2"><input NAME="name1" TYPE="submit" VALUE="Notify Me When The Site Is Back!"></font></td> </tr> </table> </form> </td> <td width="13%"> </td> </tr> <tr> <td width="92%" valign="top" height="1"> </td> <td width="8%" height="1"> </td> </tr> </table> </td> </tr> <tr> <td bgcolor="#FFFFFF" width="2%"> </td> <td width="97%" bgcolor="#FFFFFF" height="22" valign="top" align="center"> </td> </tr> <tr> <td bgcolor="#FFFFFF" width="2%"> </td> <td width="97%" bgcolor="#FFFFFF" height="22"> </td> </tr> </table> </td> </tr> </table> </body> </html>..and I referred to page The Linux and Unix Menagerie: Collecting Emails On Your Site Maintenance PageCode:-rw-r--r-- 1 apache apache 895 Sep 23 11:19 formparser.pl
and The Linux and Unix Menagerie: Backend Processing Emails Submitted During Maintenance


LinkBack URL
About LinkBacks





Reply With Quote