473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Passing cgi parameters to script...

Is there any way that I can pass cgi parameters to my script locally,
before i upload it to the webserver, so that i can debug it.

Normally I would pass parameters like this:

http://www.webserver.com/script.cgi?...by&FIELD2=GOVT

The problem is that I get errors that do not show up when I run the
script locally and I do not have access to the error logs.

So is there a way I can pass the form values TERM1, FIELD1 etc to the
script without having to upload it to the server?

Dec 29 '05 #1
3 3477
sophie_newbie wrote:
Is there any way that I can pass cgi parameters to my script locally,
before i upload it to the webserver, so that i can debug it.

Normally I would pass parameters like this:

http://www.webserver.com/script.cgi?...by&FIELD2=GOVT
The problem is that I get errors that do not show up when I run the
script locally and I do not have access to the error logs.

So is there a way I can pass the form values TERM1, FIELD1 etc to the
script without having to upload it to the server?

You might think of using CGIHttpServer to test your scripts in a
server-environment - while still being local.

Regards,

Diez
Dec 29 '05 #2
"sophie_newbie" <pa**********@gmail.com> writes:
Is there any way that I can pass cgi parameters to my script locally,
before i upload it to the webserver, so that i can debug it.

Normally I would pass parameters like this:

http://www.webserver.com/script.cgi?...by&FIELD2=GOVT


CGI paramaters are set in the environment. On Unix, in an sh-like
shell, do:

QUERY_STRING='TERM1=hello&FIELD1=TTL&TERM2=goodby& FIELD2=GOVT' www.webserver.com/script.cgi

Depending on the package you're using for handling CGI, you may need
to set other CGI parameters as well. The traceback from trying this
should give you a KeyError naming the environment variable it's
looking for.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Dec 29 '05 #3
Diez B. Roggisch wrote:
sophie_newbie wrote:
Is there any way that I can pass cgi parameters to my script locally,
before i upload it to the webserver, so that i can debug it.


You might think of using CGIHttpServer to test your scripts in a
server-environment - while still being local.


Which can be as simple as typing
python -c "import CGIHTTPServer; CGIHTTPServer.test()"

from the command line in the root dir of your site (the dir that
contains the cgi-bin dir).

Kent
Dec 30 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: JD | last post by:
I want to pass two parameters to a simple script running on my web server. The script "parpass.php" looks like this: <?php echo "The total number of parameters passed was: $argc \n"; echo...
1
by: JD | last post by:
I posted this earlier and it disappeared from the NewsGroup I want to pass two parameters to a simple script running on my web server. The script "parpass.php" looks like this: <?php echo...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
4
by: Nathan Sokalski | last post by:
I am a beginner with AJAX, and have managed to learn how to use it when passing single parameters, but I want to return more than one value to the client-side JavaScript function that displays it....
4
by: Nathan Sokalski | last post by:
I am a beginner with AJAX, and have managed to learn how to use it when passing single parameters, but I want to return more than one value to the client-side JavaScript function that displays it....
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.