CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Hiding for values

 



Gregorio
User

Aug 13, 2000, 3:19 PM

Post #1 of 5 (420 views)
Hiding for values Can't Post

I thought I had seen this done before in but I can't seem to find the post. I was wondering if you could hide the form values that appear after .cgi. For example:
http://www.mysite.com/cgi-bin/post.cgi?value1=x&value2=y

would appear as:
http://www.mysite.com/cgi-bin/post.cgi

Is this possible? Thanks.


Kanji
User / Moderator

Aug 13, 2000, 4:51 PM

Post #2 of 5 (420 views)
Re: Hiding for values [In reply to] Can't Post

You can only do that if you're using forms by setting the METHOD attribute to POST.

ie, <form action="/my/script.cgi" method="post">


Gregorio
User

Aug 14, 2000, 8:44 AM

Post #3 of 5 (420 views)
Re: Hiding for values [In reply to] Can't Post

I need to use the get function or the form doesn't work, is there anyway around that?


Kanji
User / Moderator

Aug 14, 2000, 1:22 PM

Post #4 of 5 (420 views)
Re: Hiding for values [In reply to] Can't Post

<UL TYPE=SQUARE><LI>Fix the script so it accepts POST<LI>POST to an intermediatory script that converts all input to GET format and then print out the results of getting the form you want via LWP::Simple</UL>


rGeoffrey
User / Moderator

Aug 14, 2000, 1:37 PM

Post #5 of 5 (420 views)
Re: Hiding for values [In reply to] Can't Post

It sounds like you are using a home grown CGI Parser to read your form data into a hash and only included the code to do the GET version.

If that is the case you have several options...

1) change your home grown CGI Parser to use these lines...
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


if( $ENV{'REQUEST_METHOD'} eq "GET" ){
$in = $ENV{'QUERY_STRING'};
} elsif( $ENV{'REQUEST_METHOD'} eq "POST" ){
read(STDIN, $in, $ENV{'CONTENT_LENGTH'});
}

@args = split(/&/,$in);
</pre><HR></BLOCKQUOTE>
This will get you your pairs from either GET or POST versions.

2. Use CGI.pm
3. Use CGI/Minimal.pm (available from CPAN)
4. Use CGI/Lite.pm (available from CPAN)

5. Use CGI/Thin.pm

This last one is mine and eventually I will get around to sending it to CPAN. For now it can be found at:
ftp://www.platypiventures.com/pub/perl/modules/CGI/Thin.pm

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives