Search Results

Search found 6384 results on 256 pages for 'cgi parse qs'.

Page 4/256 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • cgi.FieldStorage always empty - never returns POSTed form Data

    - by Dan Carlson
    This problem is probably embarrassingly simple. I'm trying to give python a spin. I thought a good way to start doing that would be to create a simple cgi script to process some form data and do some magic. My python script is executed properly by apache using mod_python, and will print out whatever I want it to print out. My only problem is that cgi.FieldStorage() is always empty. I've tried using both POST and GET. Each trial I fill out both form fields. <form action="pythonScript.py" method="POST" name="ARGH"> <input name="TaskName" type="text" /> <input name="TaskNumber" type="text" /> <input type="submit" /> </form> If I change the form to point to a perl script it reports the form data properly. The python page always gives me the same result: number of keys: 0 #!/usr/bin/python import cgi def index(req): pageContent = """<html><head><title>A page from""" pageContent += """Python</title></head><body>""" form = cgi.FieldStorage() keys = form.keys() keys.sort() pageContent += "<br />number of keys: "+str(len(keys)) for key in keys: pageContent += fieldStorage[ key ].value pageContent += """</body></html>""" return pageContent I'm using Python 2.5.2 and Apache/2.2.3. This is what's in my apache conf file (and my script is in /var/www/python): <Directory /var/www/python/> Options FollowSymLinks +ExecCGI Order allow,deny allow from all AddHandler mod_python .py PythonHandler mod_python.publisher </Directory>

    Read the article

  • multiple Perl ` print $cgi->header, <<HTML; .... HTML ` statement gives problem

    - by dexter
    i have something like: #!/usr/bin/perl use strict; use warnings; use CGI::Simple; use DBI; my $cgi = CGI::Simple->new; if ($cgi->param('selid')) { print $cgi->header, <<HTML; <br/>this is SELECT HTML } elsif ($cgi->param('delid')) { print $cgi->header, <<HTML; <b>this is DELETE</b> HTML } elsif ($cgi->param('upid')) { print $cgi->header, <<HTML; <b>this is UPDATE</b> HTML } when i run this i get an error like: Error message: Can't find string terminator " HTML" anywhere before EOF at C:/xampp/htdocs/perl/action.pl line 14. , and when give space between << and HTML; like :print $cgi->header, << HTML; error changes to: Error message: Can't find string terminator " " anywhere before EOF at C:/xampp/htdocs/perl/action.pl line 14. , what would be the reason for this? note: parameters are passed from another page('selid' or 'delid' or 'upid')

    Read the article

  • How do I set Perl's @INC for a CGI script?

    - by pistacchio
    I have the follwing, simplest Perl CGI script: use strict; use warnings; use CGI(); use CGI::Carp qw(fatalsToBrowser); use Template; print CGI::header(); foreach(@INC) { print "$_\n"; } When called (http://[..]/cgi-bin/p.cgi) I am given the following error: Can't locate Template.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /home/pistacchio/webapps/htdocs/cgi-bin/p.cgi line 8. BEGIN failed--compilation aborted at /home/pistacchio/webapps/htdocs/cgi-bin/p.cgi line 8. I made sure that Template is installed and indeed when running this program from shell it works (loads Template) and outputs: Content-Type: text/html; charset=ISO-8859-1 /home/pistacchio/lib/perl5 /home/pistacchio/lib/perl5/lib/i386-linux-thread-multi /home/pistacchio/lib/perl5/lib /home/pistacchio/lib/perl5/lib/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 Template is installed in /home/pistacchio/lib/perl5/lib/i386-linux-thread-multi [pistacchio@web118 i386-linux-thread-multi]$ pwd /home/pistacchio/lib/perl5/lib/i386-linux-thread-multi [pistacchio@web118 i386-linux-thread-multi]$ ls auto perllocal.pod Template Template.pm This directory is correctly listed in env and, as previously posted, in @INC. In @INC it is shown twice, so I even tried to pop it out before calling use Template, but without result. From env: [pistacchio@web118 i386-linux-thread-multi]$ env [..] PERL5LIB=/home/pistacchio/lib/perl5:/home/pistacchio/lib/perl5/lib:/home/pistacchio/lib/perl5/lib/i386-linux-thread-multi [..] Removing use Template gets rid of the problem.

    Read the article

  • cgi.FieldStorage translating unicode strangely

    - by trydyingtolive
    I have a form that is on a UTF-8 encoded page. When I submit the form cgi.FieldStorage converts any non-ascii character to an odd format. For example if I submit the value c. The browser will send %c4%87. I want to convert that to the string \xc4\x87. However, cgi.FieldStorage is converting it to \\xc4\\x87. post = cgi.FieldStorage(fp=env['wsgi.input'], environ=env, keep_blank_values=True) Python 2.6 on Ubuntu 9.10SE, Apache2, mod_wsgi.

    Read the article

  • Running a python script in background from a CGI

    - by Cagey
    I have a python CGI which runs some script in the background and shows the stdout in the html page. I run the script when the user clicks some button in the page. My problem is when the script starts running the page becomes busy and the user can't use the other client side features in the page. What I want is: The script should run in background when the user clicks the button and should notify the CGI when run is complete. Then the CGI show should the stdout of the script run. How can this be done?

    Read the article

  • CGI site , moscow ml problem

    - by Krewie
    Hello , i'm using Moscow ML combined with CGI. I have a site that calculates simple arithmetics. When the submit button i pushed, the site is redirected to the actual CGI file that outputs the result of the calculation. Although in my case, it outputs the html code in raw form rather then actually outputting the result in html. Anybody that knows a solution to this problem ? // thx beforehand

    Read the article

  • Tornado or Django works with CGI ?

    - by xRobot
    Hi at all, Tornado is a webserver + framework like Django but for real-time features. On my server I don't have a python module or wsgi module so I thought CGI. Is there a way to get Tornado ( or Django ) works by using CGI folder ? If yes, Could you explain me how do I do that ?

    Read the article

  • Why is Perl commonly used as CGI scripts?

    - by Michael Vasquez
    I plan to add a better search feature to my site, so I thought that I would write it in C and use the CGI as a means to access it. But it seems that Perl is the most popular language when it comes to CGI-based stuff. Why is that? Wouldn't it be faster programmed in C or machine code? What advantages, if any, are there to writing it in a scripting language? Thanks.

    Read the article

  • How to call cgi script from ruby

    - by Maddy
    Hello, I've a remote cgi script hosted on Apache using SSL. It takes in two input variables a and b. I want to call call the cgi script with right input variables using ruby. Any clues would be appreciated.

    Read the article

  • CGI Buffering issue

    - by Punit
    I have a server side C based CGI code as: cgiFormFileSize("UPDATEFILE", &size); //UPDATEFILE = file being uploaded cgiFormFileName("UPDATEFILE", file_name, 1024); cgiFormFileContentType("UPDATEFILE", mime_type, 1024); buffer = malloc(sizeof(char) * size); if (cgiFormFileOpen("UPDATEFILE", &file) != cgiFormSuccess) { exit(1); } output = fopen("/tmp/cgi.tar.gz", "w+"); printf("The size of file is: %d bytes", size); inc = size/(1024*100); while (cgiFormFileRead(file, b, sizeof(b), &got_count) == cgiFormSuccess) { fwrite(b,sizeof(char),got_count,output); i++; if(i == inc && j<=100) { ***inc_pb*** = j; i = 0; j++; // j is the progress bar increment value } } cgiFormFileClose(file); retval = system("mkdir /tmp/update-tmp;\ cd /tmp/update-tmp;\ tar -xzf ../cgi.tar.gz;\ bash -c /tmp/update-tmp/update.sh"); However, this doesn't work the way as is seen above. Instead of printing 1,2,...100 to progress_bar.txt one by one it prints at ONE GO, seems it buffers and then writes to the file. fflush() also didn't work. Any clue/suggestion would be really appreciated.

    Read the article

  • How do I do a postback to a CGI service

    - by TheLearner
    I am building a C# client for a CGI service (not sure what its called exactly). It accepts a bunch of XML and spits out a response. I have tested it straight in Firefox and it works (see below). Now I am not sure how to do this in C# code though? Does anyone have a helpful snippet of code, I can't imagine it would be that difficult? http://www.travelcommunications.co.uk/cgi-bin/d3web_gzip.ssh?%3CTCOML%20version=%22NEWFORMAT%22%3E%3CTransferOnly%3E%3CAvailability%3E%3CRequest%3E%3CAgentCode%3ETEST%3C/AgentCode%3E%3CAgentType%3ETA%3C/AgentType%3E%3CDeparturePointCode%3EALC%3C/DeparturePointCode%3E%3CDeparturePointType%3EAIRPORT%3C/DeparturePointType%3E%3CArrivalPointCode%3EBEN%3C/ArrivalPointCode%3E%3CArrivalPointType%3ERESORT%3C/ArrivalPointType%3E%3CSectorType%3ERETURN%3C/SectorType%3E%3CArrDate%3E10.10.10%3C/ArrDate%3E%3CArrTime%3E10:00%3C/ArrTime%3E%3CRetDate%3E17.10.10%3C/RetDate%3E%3CRetTime%3E10:00%3C/RetTime%3E%3CBrochure%3E001%3C/Brochure%3E%3CAdults%3E2%3C/Adults%3E%3CChildren%3E0%3C/Children%3E%3CInfants%3E0%3C/Infants%3E%3CCurrencyCode%3EUKL%3C/CurrencyCode%3E%3C/Request%3E%3C/Availability%3E%3C/TransferOnly%3E%3C/TCOML%3E

    Read the article

  • How do you run a uncompiled CGI?

    - by Toast
    I'm going to get right to it. iPage shared hosting. Trying to use mimetex.cgi to render math. Source code is at the link. After preparing everything just as I had with a different shared host (which worked), I get errors. Tech support tells me I need to upload the uncompiled source and use that instead. ??? Rather than going with them just being ignorant and wrong, I'm going to assume I'm missing something. How am I supposed to execute and make use of the uncompiled source code? What the hell is wrong with a hosting service that doesn't support running compiled CGI written in C (as far as I can tell)?

    Read the article

  • Stopping httpd causes a process started from perl CGI script to receive SIGTERM

    - by Pranav Pal
    I am running a shell script from a perl CGI script: #!/usr/bin/perl my $command = "./script.sh &"; my $pid = fork(); if (defined($pid) && $pid==0) { # background process system( $command ); } The shell script looks like this: #!/bin/sh trap 'echo trapped' 15 tail -f test.log When I run the CGI script from browser, and then stop httpd using /etc/init.d/httpd stop, the script receives a SIGTERM signal. I was expecting the script to run as a separate process and not be tied in anyway to httpd. Though I can trap the SIGTERM, I would like to understand why the script is receiving SIGTERM at all. What wrong am I doing here? I am running RHEL 5.8 and Apache HTTP server 2.4. Thanks, Pranav

    Read the article

  • Limit calls to external database with Python CGI

    - by Matt Ball
    I've got a Python CGI script that pulls data from a GPS service; I'd like this information to be updated on the webpage about once every 10s (the max allowed by the GPS service's TOS). But there could be, say, 100 users viewing the webpage at once, all calling the script. I think the users' scripts need to grab data from a buffer page that itself only upates once every ten seconds. How can I make this buffer page auto-update if there's no one directly viewing the content (and not accessing the CGI)? Are there better ways to accomplish this?

    Read the article

  • 404 Not Found for a PL script that exists!

    - by Abs
    Hello all, I make a GET request to a CGI script and I get a 404 error. However, I am 100% sure that script is present and it has permissions: -rwxr-xr-x 1 apache apache 6520 Sep 7 03:01 uu_ini_status_audios.pl The request URL is: http://mysite.com/cgi-bin/uu_ini_status_audios.pl?tmp_sid=893facacc5dc392ad0f4c91e6a9e8d40&rnd_id=0.12266222834382812 The error I get: The requested URL /cgi-bin/uu_ini_status_audios.pl was not found on this server. This use to work for me before, but I think it stopped working after I restarted apache so maybe it means its a configuration I changed?? I checked the error logs for apache and php and nothing useful was found to help me with my problem! I appreciate any help on this!

    Read the article

  • configuring cgi-bin using .htaccess

    - by Alexandru
    I'm trying to configure a directory as cgi-bin using .htaccess, but when I try to access the executables, the files are downloaded. I'm using apache2.2. What is the problem? My .htaccess looks like: # cat www/cgi-bin/.htaccess Options +ExecCGI AddHandler cgi-script cgi pl File permissions are # ls -1la www/cgi-bin/ total 60 drwxr-xr-x 2 root root 4096 iun 10 19:22 . drwxr-xr-x 5 root root 4096 iun 10 19:18 .. -rw-r--r-- 1 root root 46 iun 10 19:23 .htaccess -rwxr-xr-x 1 root root 15358 iun 10 19:23 paperload.cgi -rwxr-xr-x 1 root root 12728 iun 10 19:23 papers.cgi -rwxr-xr-x 1 root root 12593 iun 10 19:23 paperview.cgi

    Read the article

  • How to Implement Grep into CGI script Please?

    - by Joey jie
    Hi all! I am having difficulty figuring out how to implement grep into my CGI script. Basically I will receive a value of eg. 1500 from a HTML page. The CGI script then runs and compares 1500 to a text file. When it finds 1500 it prints the entire line and displays it on the webpage. I would like some tips and pointers on how to do this please. I understand that this involves grep but I don't really know how to put it in. #include <stdio.h> #include <stdlib.h> int main(void) { char *data; long m,n; printf("%s%c%c\n", "Content-Type:text/html;charset=iso-8859-1",13,10); printf("<TITLE>Webpage of Results</TITLE>\n"); printf("<H1>Temperatures</H1>\n"); data = getenv("QUERY_STRING"); The HTML passes the variable time=1500. I understand (correct me if I am wrong) that QUERY_STRING will contain 1500?

    Read the article

  • How to include frameset under CGI.pm

    - by neversaint
    I want to have a cgi-script that does two things. Take the input from a form. Generate results base on the input values on a frame. Primarily I want the frame exist only after the results is generated/printed. Below is the simplified code of what I want to do. But somehow it doesn't work. What's the right way to do it? #!/usr/local/bin/perl use CGI ':standard'; print header; print start_html('A Simple Example'), h1('A Simple Example'), start_form, "What's your name? ",textfield('name'), p, "What's the combination?", p, checkbox_group(-name=>'words', -values=>['eenie','meenie','minie','moe'], -defaults=>['eenie','minie']), p, "What's your favorite color? ", popup_menu(-name=>'color', -values=>['red','green','blue','chartreuse']), p, submit, end_form, hr; if (param()) { # begin create the frame print <<EOF; <html><head><title>$TITLE</title></head> <frameset rows="10,90"> <frame src="$script_name/query" name="query"> <frame src="$script_name/response" name="response"> </frameset> EOF # Finish creating frame print "Your name is: ",em(param('name')), p, "The keywords are: ",em(join(", ",param('words'))), p, "Your favorite color is: ",em(param('color')), hr; } print end_html;

    Read the article

  • Simple CGI server

    - by Egor Makarov
    How can I run my perl CGI script without apache? This is for testing purposes, so some kind of single-process server that processes only one request at time should be enough for me.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >