[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ProgSoc] arguments to webpages
> How is it possilbe (if at all) to pass an argument to a webpage in the
> URL of the page? I need an arg for a cgi embedded in the page, and it
> would be nice to just be able to type http://blah.com/blah.html?"here's
> the argument"
> Which give the string "here's the argument" to a cgi prog. If this is
> possilbe, what are the delimiters and how do I refer to the arg in the
> html?
yes its possible, all you do is exactly what you wrote above...almost.
in your html script you obviously have a hyperlink to a page that you wish to
pass the argument too?
so where the hyperlink is you just type
<A HREF='http://blah.com/blah.html?NAMEOFARG=heres%20the%20argument> The
visable hyperlink text</A>
Then, you will need the link to pass through a cgi script, using the
QUERY_STRING environment variable (I believe thisis an enironment variable?),
you can take the argument and split it into its name and value pair, then
build your html page using that argument.
Of course you have to remember to replace all the special characters in the
argument with the html code. such as space, punctuation etc....
hope this helps.
Adrian
--
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.
This list is archived at <http://www.progsoc.uts.edu.au/lists/progsoc/>