Post/Forms through a redirect

Results 1 to 4 of 4

Thread: Post/Forms through a redirect

  1. #1
    Ben Roy Guest

    Default Post/Forms through a redirect

    Here&#039s the scenario:<BR><BR>Page1<BR>A form with a field for the users email to subscribe to a service.<BR><BR>Page2<BR>A generic page handler that matches page requests with templates and appropriate headers, etc from the database.<BR><BR>Page3<BR>Script to handle subscribing the user. This file reads the email via Request.Form("email_addr") and cannot be modified by us in any way.<BR><BR>Basically what happens is the user types in their email and hits submit. The info is submitted to page 2. When page2 finds the right template, it redirects to the appropriate URL, appending the querystring so as not to lose any information. Unfortunately, submitted info is not in the query string. I modified it to also append Request.Form, however this doesn&#039t work because page3 is looking in Request.Form and when I append Request.Form to the URL it is then only accessible via Request.Querystring or Request.Item. So what I need to know is, can I make a Request.Redirect submit like a form would?

  2. #2
    Steve Cimino Guest

    Default RE: Post/Forms through a redirect

    Here&#039s a response from Atrax, awhile back. I know he is referring to cookies, but I think this also applies to the FORM.<BR>--------------------------------------------------<BR><BR>Cookies are set by the browser on receipt of a successful http response (200 response code)<BR><BR>what response.redirect does is overrides this 200 and sends a 302 (object moved) response. therefore you can&#039t set cookies and then response.redirect to another page, as the cookie will never get set<BR><BR>you could send a meta refresh tag to the browser in place of the redirect, but you&#039re not guaranteed that&#039ll work. likewise for using a piece of javascript to redirect after a 200 (cookie setting) response - but you&#039d have to use one of those methods, and write a text link to be on the safe side which just says &#039redirecting..&#039

  3. #3
    Ben Roy Guest

    Default RE: Post/Forms through a redirect

    I guess I&#039m not sure exactly how this applies to my question. Maybe you could elaborate a bit?

  4. #4
    Join Date
    Dec 1969
    Posts
    2

    Default RE: Post/Forms through a redirect

    Ben, based on your description it sounds like your page 2 is really what I would call an action page. It has no ui, it just does some necessary work and moves on to the next url. If that&#039s the case here&#039s what I recommend:<BR><BR>1) On Page 2, set a variable to the appropriate destination (e.g. the right template/appropriate URL + email info passed from Page 1.<BR><BR>2). Use the body tag (something like this):<BR>&#060;body onload="javascript:location.href=&#039&#060;% =Dest %&#062;&#039"&#062;<BR><BR>This should get you to whereever you need to go. You can just add the query string info as part of the url destination.


Posting Permissions

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