Redirect using a POST?

Results 1 to 3 of 3

Thread: Redirect using a POST?

  1. #1
    Join Date
    Dec 1969
    Posts
    101

    Default Redirect using a POST?

    I realize that this is probably impossible, but is there a way to redirect to another page using a POST method. I know I can always use response.redirect and add things onto the querystring, but the page that we are doing this for gets a querystring that is too long. Also, it will help with security. I know this is possible with JavaScript, but we can&#039t use it because we need to be compatible with all browsers.<BR><BR>I have also tried ASPHTTP, but that just retrieves the text returned from a page using a POST instead of actually going to that page. It also starts a new session and can&#039t read the users cookies, so there wouldn&#039t be any personalized info if we needed to get it for that user. Thanks.

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Redirect using a POST?

    Far from impossible.<BR><BR>Say you have a page that you want to take everything in the querystring and send it to page2.asp through a POST:<BR><BR>PAGE2.ASP<BR>==========<BR><BR>&#060; %<BR> &#039Get all of the querystring variables<BR> Dim whatever1, whatever2, whateverN<BR> whatever1 = Request.QueryString("...")<BR> ...<BR><BR>&#037;&#062;<BR><BR>&#060;FORM METHOD=POST ACTION="page2.asp" NAME="myForm"><BR>&#060;INPUT TYPE=HIDDEN NAME="whatever1" VALUE="&#060;%=whatever1&#037;&#062;"><BR>&#060;IN PUT TYPE=HIDDEN NAME="whatever2" VALUE="&#060;%=whatever2&#037;&#062;"><BR>...<BR>& #060;/FORM><BR><BR>&#060;SCRIPT LANGUAGE=JavaScript><BR>document.myForm.submit();< BR>&#060;/SCRIPT><BR><BR>Does this do what you are looking for?

  3. #3
    Join Date
    Dec 1969
    Posts
    101

    Default RE: Redirect using a POST?

    This does do what I am looking for, but we can&#039t use JavaScript on our site. It is a very large site and we need to support all browsers, JavaScript or not, so this wouldn&#039t work. I was looking more for a component, or some secret way to do this in server-side scripting only. Like:<BR><BR>response.post("/personalize.asp", "fname=Matt&lname=Anderson")<BR><BR>I know that doesn&#039t exist, but I certainly wish that it did. Thanks for the idea though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •