cgi

Redirecting from one CGI page to another

有些话、适合烂在心里 提交于 2019-12-11 17:14:19
问题 Merged with How can I redirect the client from one CGI page to another using Perl?. I am a nembie to CGI with Perl, please do help me out and please do correct me wherever I have committed a mistake. This is the code. The problem is that after the password is validated and found as correct, instead of redirecting to the next page it is giving this message: Status: 302 Found Location: http://localhost/cgi-bin/Main.cgi #!C:\perl\bin\perl.exe use CGI qw(:standard); use CGI::Carp qw

Run CGI application without redirecting from HTML

梦想的初衷 提交于 2019-12-11 15:31:38
问题 I have an html page populated from a cgi app. Right now when I make a change on my html page through a form <form action="/cgi-bin/Lib.exe" method=POST name="checks" ID="Form2"> It takes me from http://localhost/index.html to http://localhost/cgi-bin/Lib.exe where the CGI outputs some debug lines I put in there. I then have to manually go back to the index to see it updated. When the html form sends a request to the cgi application, the CGi application makes the update to the database and re

apache---httpd.conf详解

别等时光非礼了梦想. 提交于 2019-12-11 15:28:25
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> # # Apache服务器主配置文件. 包括服务器指令的目录设置. # 详见 < URL:http://www.apache.org/docs/ > # # 请在理解用途的基础上阅读各指令。 # # 再读取此文档后,服务器将继续搜索运行 # E:/Program Files/Apache Group/Apache/conf/srm.conf # E:/Program Files/Apache Group/Apache/conf/access.conf # 除非用ResourceConfig或AccessConfig覆盖这儿的标识 # # 配置标识由三个基本部分组成: # 1. 作为一个整体来控制Apache服务器进程的标识 (the 'global environment'). # 2. 用于定义主(默认)服务器参数的标识。 # 响应虚拟主机不能处理的请求。 # 同时也提供所有虚拟主机的设置值。 # 3. 虚拟主机的设置。在一个Apache服务器进程中配置不同的IP地址和主机名。 # # 配置和日志文件名:指定服务器控制文件命名时, # 以 "/" (或 "drive:/" for Win32)开始,服务器将使用这些绝对路径。 # 如果文件名不是以"/"开始的,预先考虑服务器根目录-- # 因此 "logs

How to populate SCRIPT_FILENAME and SCRIPT_PATH server vairables to php-cgi from the command line

梦想与她 提交于 2019-12-11 14:19:16
问题 I'm trying to run cron php script from command line. The server does not have PHP CLI but php-cgi exists. I tried to pass PHP directly to php-cgi but this does not work because two server environment variables are missed ( $_SERVER['SCRIPT_FILENAME'] and $_SERVER['SCRIPT_PATH'] ). I tried to fill variables using following recommendation but these variables are not populated. What is missed in this answer? How to make php-cgi populate these server values? The question is not platform specific,

interface between perl script and HTML with CGI

倾然丶 夕夏残阳落幕 提交于 2019-12-11 13:18:41
问题 I am new to Perl and HTML . I have written a back end script in Perl using send expect statements, for loops and subroutines. In the Perl script i am logging in to the server and sending some commands and expecting server prompt and finally exit .Now i am trying to bring it to front end using HTML. I am using CGI as a framework to achieve this. This is my part of the code #!/usr/bin/perl use Expect; use Switch; use warnings; use 5.008; use Data::Dumper; use CGI; my $q = CGI->new; my %data;

How can I get both the GET and POST request params, on a POST request?

筅森魡賤 提交于 2019-12-11 12:23:38
问题 I'm creating a facebook app with a Perl backend. The problem is that since Facebook sends the request to my web app as a POST request I'm having a problem getting the GET parameters that were also part of the base URL for the application -- in effect I'm only getting the POST params from $CGI->Vars. 回答1: See CGI/MIXING POST AND URL PARAMETERS. Short version: use $CGI->param() for post paramenters and $CGI->url_param() for query string parameters. 回答2: Dump CGI in favour of a better interface.

Nginx serving C++ cgi script: response is binary format

删除回忆录丶 提交于 2019-12-11 12:13:56
问题 I am trying to run C++ CGI script on nginx. I am using FCGIWrap with script from nginx website. The program code is like this: #include <iostream> using namespace std; int main () { cout << "Content-type:text/html\r\n\r\n"; cout << "<html>\n"; cout << "<head>\n"; cout << "<title>Hello World - First CGI Program</title>\n"; cout << "</head>\n"; cout << "<body>\n"; cout << "<h2>Hello World! This is my first CGI program</h2>\n"; cout << "</body>\n"; cout << "</html>\n"; return 0; } And I compiled

How do I send values with POST when redirecting in Perl?

半腔热情 提交于 2019-12-11 11:45:45
问题 I have two values one for name and another for password that I would like to pass to another page if the user entered the right combination. If the user did I know that I can redirect by including the values in the query string like: $cgi->redirect('http:someotherpage.com?username=$username&password=$password'); but that is using a GET request, is there a way to do the same thing using a POST or is there another way to pass on the values when redirecting in Perl? I know that JSP has a method

How do I use a Perl CGI locally without using curl and apache2?

耗尽温柔 提交于 2019-12-11 11:19:03
问题 I would like to submit a form to a CGI script localy (w3c-markup-validator), but it is too slow using curl and apache , I want to use this CGI script more than 5,000 times in an another script. and currently it takes more than one hour. What should I do to give the form directly to the CGI script (I upload a file with curl )? edit: It seems to be too complicated and time consuming for what I needed, so I waited 1 hour and a half, each time I needed to test my generated xhtml files. In

python CGI : upload error

假装没事ソ 提交于 2019-12-11 11:02:46
问题 I use Python version 3.4 and this is server source code in python import io from socket import * import threading import cgi serverPort = 8181 serverSocket = socket(AF_INET, SOCK_STREAM) serverSocket.bind(('', serverPort)) serverSocket.listen(5) def serverHandle(connectionSocket, addr): try: message = connectionSocket.recv(1024) if not message: return path = message.split()[1].decode('utf-8') if path == '/': connectionSocket.send(b'HTTP/1.1 200 OK\r\n') connectionSocket.send(b'Content-type: