473,738 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Embedding a URL as an argument to a CGI program

Is this possible - I imagine so but cannot at the moment fathom out how
to do it!

Entering into the URL field in a browser the name of a cgi program like
this:

http://myserver/cgi-bin/prog

No problem

When prog has arguments, send them like this:

http://myserver/cgi-bin/prog?arg1=X&arg2=Y

Now prog needs an argument which is itself a URL so:

http://myserver/cgi-bin/prog?arg1=X&...?arg1=17&arg2=
299 ... etc.

How can I embed the URL which is the value to be sent into arg_url?

This worked (to my surprise):

http://myserver/cgi-bin/prog?arg1=X&...=prog2?arg1=17

but as soon as I tried to add more &arg2= ten the browser errored

I experimented with replacing the & for %38% and the = with %61% but
seem unable to successed - am I using the incorrect approach?

Appreciate any help you guys can give!

BTW the reason is that I want prog to be a generic program which
generates a frameset with one window containing the conetents of
whatever URL it is passed - building generic code.

cheers

--

jeremy
Jul 23 '05 #1
3 1553

Jeremy wrote:

Is this possible - I imagine so but cannot at the moment fathom out how
to do it! Entering into the URL field in a browser the name of a cgi program like this: http://myserver/cgi-bin/prog No problem When prog has arguments, send them like this: http://myserver/cgi-bin/prog?arg1=X&arg2=Y Now prog needs an argument which is itself a URL so: http://myserver/cgi-bin/prog?arg1=X&...?arg1=17&arg2=
299 ... etc. How can I embed the URL which is the value to be sent into arg_url? This worked (to my surprise): http://myserver/cgi-bin/prog?arg1=X&...=prog2?arg1=17 but as soon as I tried to add more &arg2= ten the browser errored I experimented with replacing the & for %38% and the = with %61%
but
seem unable to successed - am I using the incorrect approach? Appreciate any help you guys can give! BTW the reason is that I want prog to be a generic program which
generates a frameset with one window containing the conetents of
whatever URL it is passed - building generic code. cheers


You have to URL-encode the "&" and "?". Actually, the "&" is what throws
it off. Simply replace "&" with "%26" and "?" with "%3F" before you
construct the CGI query.

Sincerely,
Dmitri
http://www.1-script.com/install/
Check out my CGI scripts installation offer
-------------------------------------
##-----------------------------------------------#
Article posted with Web Developer's USENET Archiv
http://www.1-script.com/forum
no-spam read and post WWW interface to your favorite newsgroup -
comp.infosystem s.www.authoring.html - 7697 messages and counting
##-----------------------------------------------##
Jul 23 '05 #2
In article <hS************ *********@news. easynews.com>, www.1-script.com
says...

You have to URL-encode the "&" and "?". Actually, the "&" is what throws
it off. Simply replace "&" with "%26" and "?" with "%3F" before you
construct the CGI query.


Thanks very much Dmitiri, this is just what I was looking for.

--
jeremy
Jul 23 '05 #3
In article <hS************ *********@news. easynews.com>, www.1-script.com
says...
You have to URL-encode the "&" and "?". Actually, the "&" is what throws
it off. Simply replace "&" with "%26" and "?" with "%3F" before you
construct the CGI query.

Actually still having some trouble with this - do I also need to url-
encode the = characters as well?
--

jeremy
Jul 23 '05 #4

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

Similar topics

0
2513
by: jordi | last post by:
Hi, I'm starting to use Python embedded in a C program. I'm using Python to execute several scripts using as a variables information retrieved for several multithread "agents" written in C. The method is: 1- Create a thread for each agent (I use a pool thread, every agent run in a different thread) 2- Precompile a different script for each agent. 3- Make the agent retrieve its data
2
2870
by: Roose | last post by:
With some googling I have found these resources: http://docs.python.org/ext/win-dlls.html http://www.python.org/doc/faq/windows.html I have a large Win32/MFC/C/C++ application that has an embedded scripting language (a very limited one). I would like to rip it out and replace it with Python. I am thinking that this would be relatively simple since the scripting language is a very small interface between the UI and the engine --...
1
322
by: gavinpaterson | last post by:
Dear Pythoners, I am writing as I am having trouble embedding a Python program into a Win XP C++ console application. I have written a script file for importing and I am trying to use the example for "Pure Embedding" found in the product documentation. The program fails to successfully execute past the line:
5
2319
by: Avi Kak | last post by:
Folks, Does regular expression processing in Python allow for executable code to be embedded inside a regular expression? For example, in Perl the following two statements $regex = qr/hello(?{print "saw hello\n"})mello(?{print "saw mello\n"})/; "jellohellomello" =~ /$regex/;
6
3008
by: Qun Cao | last post by:
Hi Everyone, I am a beginner on cross language development. My problem at hand is to build a python interface for a C++ application built on top of a 3D game engine. The purpose of this python interface is providing a convenient scripting toolkit for the application. One example is that a user can write a python script like: player = Player() game.loadPlayer(player) player.moveTo(location)
10
10788
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language Aquisition Device (2) Color Aqusition Device (3) Sound Aquistion Device (4) Smell Aquisition Device (5) Touch Aquisition Device (6) Art Aquisition Device
3
1728
by: newshop | last post by:
Dear Guru, this is about command-line argument program. is it possible to generate excel file with the command line program ? example of the argurment is: C:\test.exe <filename.txt>, which I compiled test.cpp if I execute: test fileA.txt
6
465
by: mistabean | last post by:
Hello, first of all, I am a programming newbie, especially in python... Onwards to the problem, I have been having difficulty embedding a python module into my C/C++ program. (just a test program before moving on into the real thing). I have been making test runs using the codes from http://docs.python.org/ext/pure-embedding.html as a basic, but modifiying it now as a function inside my C/C++ code.
0
1354
by: DevEng | last post by:
Hi all, I am new to Python and trying to embed it into a c/c++ application. I started with examples from the documentation pages and go to the Pure Embedding example (http://docs.python.org/ext/pure-embedding.html). I can compile and run this example on wxDevC++ with a mingwin compiler. However when I tried this with Borland C++ Builder 5 I get linker errors. The code is the same exactly (the same main.c file), the only
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8787
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9208
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6750
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.