473,545 Members | 1,858 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 1544

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
2504
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...
2
2854
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...
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
2303
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
2987
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 =...
10
10755
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...
3
1716
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...
0
1340
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...
0
7486
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...
0
7676
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7932
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7442
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7776
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...
1
5347
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...
0
4965
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3473
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...
0
729
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...

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.