Jdavis wrote:
> hello,
>
> I have a perl/cgi scrip that Im trying to link to and pass a var like
> so..
>
> <form action="the_prima.cgi?instance=25" method="post">
>
> the page im linking from has a <TEXTAREA> that gets filled in by a user.
>
> <textarea NAME="content" ROWS="15" COLS="60" style="background-color:
> #CCCCCC" scrolling="no">Prima Gallery,</textarea>
>
> the <TEXTAREA>s name is 'content'. SO the_prima.cgi
> scrip has a if loop to determine the instance to use. In this case
> Im calling instance 25. But the way i append it to the url is
> interfering with the $content of the <TEXTAREA>. The $content never
> shows up with post... and with get it overwrites the "?instance=25" with
> ?content=blah%20blah"
If you use POST then the input fields will be sent in the body of the HTTP
request from the browser, and described by the HTTP headers
Content-Type and Content-Length. Apache will provide this data on
the STDIN filehandle for the CGI to read. I can't say for sure on other
servers as my experience is only with Apache.
With GET they will be sent as a query string on the URL, but the browser
will strip off any already there, which is why you are losing the instance=25.
Apache will pass this into CGI code in the QUERY_STRING environment variable.
To get the 'instance' in at the same time as the input field values you would
have to add a hidden field to the form
<input type=hidden name=instance value=25>
instead of coding it into the script URL. Then it would appear in QUERY_STRING
or on STDIN together with the 'content' value.
You could probably do both, and leave the 'instance' value as it is but use GET
as the method and receive the user input fields in the request body. You would
then get 'instance' in the query string and 'content' on STDIN. Try it and see.
HTH,
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]