Professional Web Applications Themes

redirect but with post data - mimick form post behaviour - Coldfusion - Advanced Techniques

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....

  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. #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

  3. #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

  4. #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 ing 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

  5. #5

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

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

Similar Threads

  1. #22427 [Com]: Missing Form Post Data
    By zero at tilt dot eu dot org in forum PHP Bugs
    Replies: 7
    Last Post: July 21st, 11:19 AM
  2. Email form data AND post to a page
    By jgaluska in forum Coldfusion - Getting Started
    Replies: 3
    Last Post: July 30th, 03:02 PM
  3. How to post some data in form of POST action of forms in asp?
    By Mehdi Mousavi in forum ASP Components
    Replies: 1
    Last Post: September 19th, 05:16 PM
  4. form data will not post
    By Nomen Nescio in forum PHP Development
    Replies: 10
    Last Post: August 13th, 11:48 AM
  5. ASP, FORMS, POST METHOD And Post with out form(???)
    By Don Glover the younger in forum ASP
    Replies: 2
    Last Post: July 13th, 03:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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