in reply to Re^5: INSERT file contents inside a table
in thread INSERT file contents inside a table
Hi, thnaks for your reply. I am doing it with a front end html code.
Here's my front end html code. it's release.html
<html> <head> <title>Release your email</title> </head> <body bgcolor="#95B8DB" onload="parent.adjustMyFrameHeight();"> <form action="/cgi-bin/release.pl" method="post"> <h1>Release your email</h1> <div style="height:500px; dispaly:block;">Pls input the Mail ID: <inpu +t name="release" size="20" style="height:30px"> <input type="submit" +value="Release" style="height:30px"></div> </form> </body> </html>
Here's the release.pl code. It works. Remember I still am a Novice. Pls don't blame my perl code. I don't feel shy. Everyone learns little by little. any way, This code works.
#!/usr/bin/perl use CGI qw(:standard); $ENV{"PATH"} = "/usr/sbin:/usr/bin:/sbin:/bin"; $release = param('release') || '<i>(No input)</i>'; print "Content-type: text/html\n\n"; print "<body bgcolor=\"#95B8DB\">"; print "<h1>You are releasing: $release</h1>"; system("/bin/echo > /tmp/releaseme"); system("sudo /bin/chmod 777 /tmp/releaseme"); system("sudo /usr/bin/amavisd-release $release 2> /tmp/releaseme"); if (system("less /tmp/releaseme |grep Ok > /dev/null") == 0) { print "<h2>Your Mail ID $release was released.\n</h2>"; print "<br />"; } else { print "<h2>Error!!! Wrong Mail ID, Pls Input the Right Mail ID +.\n</h2>"; print "<br />"; } print "</body>";
Anyway, I had to change the code since it gave an error due to below line in that release.pl code
$release = param('release') || '<i>(No input)</i>';
I changed it in this way. Pls see the below release.pl code. THIS IS the code I now use. But does NOT work
#!/usr/bin/perl use CGI qw(:standard); $ENV{"PATH"} = "/usr/sbin:/usr/bin:/sbin:/bin"; #$release = param('release') || '<i>(No input)</i>'; print "Content-type: text/html\n\n"; print "<body bgcolor=\"#95B8DB\">"; #print "<h1>You are releasing: $release</h1>"; print "<h1>You are releasing: $id</h1>"; system("/bin/echo > /tmp/releaseme"); system("sudo /bin/chmod 777 /tmp/releaseme"); system("sudo /usr/bin/amavisd-release $id 2> /tmp/releaseme"); if (system("less /tmp/releaseme |grep Ok > /dev/null") == 0) { print "<h2>Your Mail ID $id was released.\n</h2>"; print "<br />"; } else { print "<h2>Error!!! Wrong Mail ID, Pls Input the Right Mail ID +.\n</h2>"; print "<br />"; } print "</body>";
Many thanks for your reply. Your INPUTS r welcome. Thanks a lot
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: INSERT file contents inside a table
by poj (Abbot) on Jun 06, 2018 at 19:34 UTC | |
by theravadamonk (Scribe) on Jun 07, 2018 at 05:07 UTC | |
by poj (Abbot) on Jun 07, 2018 at 06:21 UTC | |
by theravadamonk (Scribe) on Jun 07, 2018 at 11:45 UTC | |
by poj (Abbot) on Jun 07, 2018 at 12:27 UTC | |
|