redirect but with post data - mimick form post behaviour

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default redirect but with post data - mimick form post behaviour

    Any thoughts on how to mimic result of submitting form data via POST Method? I
    have some code that sanitizes some submitted formfields and i'd like to
    redirect the user to another page and carry over that data but not reveal it in
    the URL.

    LuckyNinja Guest

  2. Similar Questions and Discussions

    1. #22427 [Com]: Missing Form Post Data
      ID: 22427 Comment by: zero at tilt dot eu dot org Reported By: jroland at uow dot edu dot au Status: No...
    2. Email form data AND post to a page
      Newbie here... Can anyone help me? I am able to email form data successfully via CFmail upon submit. I am able to post the data to a page after...
    3. How to post some data in form of POST action of forms in asp?
      Hi there, I need to post some information into an ASP page (mypage.asp), in form of POST action which I do with the following code: 'contents...
    4. form data will not post
      can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to ...
    5. ASP, FORMS, POST METHOD And Post with out form(???)
      Lets see if I can decribe, this... I have a form on an html page, that will call a remote site with a post method. Prior to running off to the...
  3. #2

    Default Re: redirect but with post data - mimick form postbehaviour

    Set all the data in the SESSION scope and then you can reference it on the later pages!
    Stressed_Simon Guest

  4. #3

    Default Re: redirect but with post data - mimick form postbehaviour

    I was thinking that, just build a struct and put it into a session var. But i really don't need this data to go into a session to use it later.
    LuckyNinja Guest

  5. #4

    Default Re: redirect but with post data - mimick form postbehaviour

    Depending on how controlled the user base is with regards to Javascript, you
    could use Javascript to do it. On the redirecting page, recreate the form (you
    could use all hidden form variables so they don't actually see anything) then
    put in a form.submit() call to automatically submit the form which will, in
    turn redirect the user. Stressed_Simon's suggestion of using the session scope
    will work as well, and be much more reliable if you're making an application
    for use by the general public. Something like: On the redirecting page, before
    the redirect: <cfset session.form_vars = Duplicate(form)> On the destination
    page: <cfif IsDefined('session.form_vars')> <cfset form =
    Duplicate(session.form_vars)> <cfset StructDelete(session,'form_vars')>
    </cfif> The first piece of code would copy your entire form scope to a session
    variable, then the second piece would get called and move the copied form scope
    back out of the session and into the form scope where it belongs, then delete
    it from the session scope to prevent it from hanging around forever and
    potentially screwing up subsequent executions. (Note that I haven't tested
    this code, but I'm pretty sure that's what I used when I had the same problem
    some time back)

    jhandfield Guest

  6. #5

    Default Re: redirect but with post data - mimick form postbehaviour

    Why not resubmit the sanitized fields with the CFHTTP tag?
    sdsinc_pmascari Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139