crabbie_upk has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I would like to know about redirecting along with POST parameters by doing which I can prevent users capturing the parametrs.
Let me explain about my current scenario.

But with this logic it is possible to view the parameters being sent through HTML form which I want to prevent.

Also I don't want to use the redirection with get method (CGI::redirect('http://myserver2.com/capture.cgi?prm1=x&prm2=y) in which again it is possible to see the passed parameters.

Is there any other way to redirect user to different domain with post parameters? Any help in this regards is really appreceated.

Thanks,
UPK.
  • Comment on Redirection and Post parameters in Perl

Replies are listed 'Best First'.
Re: Redirection and Post parameters in Perl
by chromatic (Archbishop) on Oct 13, 2005 at 06:04 UTC

    I think you're asking for a way to ask the client to send data to a form without the client actually seeing that data. Unfortunately, the client has to see the data to send it somewhere, whether via GET or POST (or even PUT or DELETE), and you can't trust the client.

    In short, no matter what you want the client to do or not do, the client can do anything it likes with the data you send it. If you don't want the client to do something with a piece of data, don't send it to the client.

Re: Redirection and Post parameters in Perl
by Skeeve (Parson) on Oct 13, 2005 at 05:58 UTC

    So you want tthe client to access Domain A by clicking on a link.

    That link should give the client a new URL redirecting him to Domain B.

    Additionally Domain B should get some information generated on Domain A, but the client should be unable to see that information?

    Question: Is it important that the client can't see the content of that information or is it important that he can't see that information is passed at all?

    I think the only way to achieve this is by a connection between Domain A and B:

    1. Client access A
    2. A generates Information and a unique key and sends this to B
    3. B stores this information
    4. A redirects the cient to a URL on B. The URL contains this unique key
    5. B recognises the unique key and retrieves the stored information

    I think this is the way most adservers work.

    But: Is this a perl question?


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
Re: Redirection and Post parameters in Perl
by snowhare (Friar) on Oct 13, 2005 at 14:31 UTC

    Back up a step and tell us what you are trying to do (at the human concepts level, not the low-level mechanics of implementation).

    I can easily think of at least two different things that satisfy your specifications above - but without knowing what you are really trying to do, it is a waste of my time to iterate "try this" suggestions as you gradually reveal the real goal and its corresponding restrictions on acceptable solutions.

      Hi All, Thanks for your response. Let me try to make my request clear again. The language I am using is Perl. Task is to pass the some confidential information from one domain A to another domain B when user click on a link hosted on domain A. Please note that the domain A and domain be are two different sites hosted on different servers which apart geographically. While doing this I can't use GET/POST method as the client side users can capture the information being passed which I don't want. Any suggestion on this task is really appreciated. Crebbie_upk.

        You could proxy the request: take the user's request to site A, have your script add the "secret" parameters and perform the query to sit B directly (via one of the LWP modules for example). Then display the results back to the client (you may have to sanitize the output before displaying, to make sure none of the confidential information is returned in the page).

        A word of warning though, if your information is indeed confidential you should not be posting it to an http address (as your OP indicates), the communication should at least be SSL-secured.

Re: Redirection and Post parameters in Perl
by johnnywang (Priest) on Oct 13, 2005 at 05:44 UTC
    Can you break your item 2 into several items? I can't figure out what you're doing in item 2.