cgi

Get input from HTML form in other document using perl and checking input

ぐ巨炮叔叔 提交于 2019-12-24 08:27:26
问题 I have two seperate perl documents: mailcheck.pl loggingpage.pl Mailcheck prints out a form in html where the user can put in her/his email and checks if the input is a valid email address. Then it calls upon the loggingpage.pl which saves the email in a logfile and gives out information to the user if the email address was successfully stored. These are the two documents: mailcheck.pl: #!/usr/bin/perl use strict; use warnings; print "Content-type: text/html\n\n"; print <<HTML; <html> <head>

How to create table for my perl output using perl cgi?

巧了我就是萌 提交于 2019-12-24 07:18:45
问题 Here is my code and output i was unable to create the different row for my each line using perl? Here is my code: use strict; use warnings; use CGI; open(my $file1,"as.txt"); my $firstline=<$file1>; $firstline=~s/.*=//g; my @words=split /,/,$firstline; my $finalline=join("\n",@words); close $file1; print "Content-type:text/html\n\n" print<<"EOF"; <html><body> <table style="width:100%"> <tr> <th>UserName</th> <th>Access</th> </tr> <tr> <td>$finalline</td> <td> <input type="checkbox" value=

Why hangs the web page after it started a daemon on the underlying server?

寵の児 提交于 2019-12-24 06:49:54
问题 I would like to start/stop a daemon process on my home server via a simple web page. The html is like this: <form action="http://192.168.2.101/cgi-bin/managedaemon.pl" method="post"> <input type="submit" value="Start" name="start"/> <input type="submit" value="Stop" name="stop"/> </form> The managedaemon.pl is like this: #!/usr/bin/perl system("/usr/local/theprog/startserver"); print "Content-type:text/html\r\n\r\n"; print "<html>"; ... And the startserver is like this: #!/bin/bash cd /usr

Working in Python cgi with form. Empty input error

▼魔方 西西 提交于 2019-12-24 04:37:28
问题 I am trying to work with forms on python and I have 2 problems which I can't decide for a lot of time. First if I leave the text field empty, it will give me an error. url like this: http://localhost/cgi-bin/sayHi.py?userName= I tried a lot of variants like try except, if username in global or local and ect but no result, equivalent in php if (isset(var)). I just want to give a message like 'Fill a form' to user if he left the input empty but pressed button Submit. Second I want to leave what

When try to execute a cgi script, get the error: “[WinError 193] %1 is not a valid Win32 application”

泪湿孤枕 提交于 2019-12-24 04:29:08
问题 When I try to execute a cgi script (via a localhost), I get the following error OSError: [WinError 193] %1 is not a valid Win32 application Any ideas why ?? Completely lost... . Additional Information: The localhost is generated by the following python -m http.server --cgi 8000 The cgi script is called by an ajax 'get' request (simplified) ajax({ type: "GET", url: "cgi-bin/myScript.cgi", onSuccess: function(html){ //do stuff } }); I have tested to check whether it's the contents of the cgi

Dynamic <img> tags unnecessarily reloading static images

社会主义新天地 提交于 2019-12-24 03:12:51
问题 I already asked this question at <img> tag not respecting max-age, and unnecessarily reloading images and thought the comments provided a satisfactory answer, but turns out I was mistaken. In the six months since, I think I've thought up a solution, but want to check it out here before implementing it. Will it work? Is it worth implementing? Any simpler solution? etc. To briefly re-describe the problem, I have a cgi program that generates gif images for html pages with tags like the following

Dynamic <img> tags unnecessarily reloading static images

Deadly 提交于 2019-12-24 03:12:14
问题 I already asked this question at <img> tag not respecting max-age, and unnecessarily reloading images and thought the comments provided a satisfactory answer, but turns out I was mistaken. In the six months since, I think I've thought up a solution, but want to check it out here before implementing it. Will it work? Is it worth implementing? Any simpler solution? etc. To briefly re-describe the problem, I have a cgi program that generates gif images for html pages with tags like the following

Apache CGI redirect to absolute URI doesn't work

浪子不回头ぞ 提交于 2019-12-24 01:59:12
问题 I have Apache 2.2.13 running in console mode on Windows. I have made an executable that handles requests. In a certain case, when it detects a URL pointing to a directory but has not trailing slash, it tries to redirect to the same URL with the missing slash appended. The exit-code is set to 301. Strangely enough, having this in the response header doesn't work: Location: /cgi-bin/mycgi.exe/something/ but this does: Location: something/ Am I doing something wrong? Or did I discover a bug in

Steps in order to pass data from HTML form to Perl script

白昼怎懂夜的黑 提交于 2019-12-24 01:44:41
问题 I have created a simple HTML, which contains the form below: <form action="WEB-INF/cgi/run.pl" method="post"> <table border="0" cellspacing="0"> <tbody> <tr><th align="center" bgcolor="F7F5F2"> <p class="normal">Submission Form</p> </th></tr> <tr><td align="center" bgcolor="F7F5F2"> <p class="normal">Insert your text below:</p> </td></tr> <tr><td><textarea wrap="virtual" name="seq_data" rows="15" cols="80"></textarea></td></tr> </tbody></table> or upload a file : <input type="file" name="file

How can I access parameters passed in the URL when a form is POSTed to my script?

大憨熊 提交于 2019-12-24 00:59:10
问题 I've run into an issue with mod_rewrite when submitting forms to our site perl scripts. If someone does a GET request on a page with a url such as http://www.example.com/us/florida/page-title , I rewrite that using the following rewrite rule which works correctly: RewriteRule ^us/(.*)/(.*)$ /cgi-bin/script.pl?action=Display&state=$1&page=$2 [NC,L,QSA] Now, if that page had a form on it I'd like to do a form post to the same url and have Mod Rewrite use the same rewrite rule to call the same