Results 1 to 2 of 2

Thread: Hook system and redirect, posting session data to good_url, ini files

  1. #1
    Join Date
    Apr 2008
    Posts
    23

    Default Hook system and redirect, posting session data to good_url, ini files

    Hey there,

    Let me first say that your formmail script is awesome, thank you for sharing it with the public.

    I found I had need to do some modifications, and considered using the hook system, but discovered something in the process worth pointing out:

    The final hook, @include("../tectite/$HOOK_DIR/fmhookpostfinish.inc");,
    occurs AFTER the call to Redirect() is made (only if a Good Url is specified),
    and Redirect() calls session_write_close() ....

    So my issue was, I was trying to have it so that it writes all the form data to the session before passing to good_url (so I can have more control on good_url) ... and it wasn't working. I was banging my head trying to figure out why the data wasn't coming through, and then I saw the session_write_close call. I found I had to have it put the stuff into the session before the session_write_close() call to have it work.

    I guess I could get around this by using an earlier hook into the system, but the comment said
    //
    // Hook system: after finishing (before session is cleared)
    //
    which I guess is true, but the session IS cleared before that point. In fact, if it's redirecting, it will never get to the final hook point, because Redirect() is calling exit.

    In addition, I've commented out the body of the ZapSession() function in case it destroys my data.

    As far as feature requests, I add my votes to:
    • Handling of more options in .ini files (derived fields, mail options, etc)
    • Better documentation of certain features (the hook system , what exactly can be done with the computation module, advanced templates, etc.)
    • having it keep track of what it adds to the session and then only explicitly unset()ting those, instead of zapping the whole session


    I'm sure you have a list a mile long, but since you seem to solicit user feedback, there's mine

    Thanks again

    Aaron

  2. #2
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Hook system and redirect, posting session data to good_url, ini files

    Hi,

    Quote Originally Posted by aaron_w View Post
    Let me first say that your formmail script is awesome, thank you for sharing it with the public.
    Thanks.

    I guess I could get around this by using an earlier hook into the system, but the comment said
    //
    // Hook system: after finishing (before session is cleared)
    //
    which I guess is true, but the session IS cleared before that point. In fact, if it's redirecting, it will never get to the final hook point, because Redirect() is calling exit.

    In addition, I've commented out the body of the ZapSession() function in case it destroys my data.
    Correct session handling with multipage forms, error handling, and complex websites is difficult. We have to be very careful about changes to this logic.

    I agree that the comment should be updated to make the problem you've encountered clearer.

    However, I think you simply need to use this hook file: fmhookprefinish.inc (and disable ZapSession, as you've done).

    As far as feature requests, I add my votes to:
    • Handling of more options in .ini files (derived fields, mail options, etc)
    • Better documentation of certain features (the hook system , what exactly can be done with the computation module, advanced templates, etc.)
    • having it keep track of what it adds to the session and then only explicitly unset()ting those, instead of zapping the whole session
    Yes, all these were either on the TO DO list or are now on it!

    I'm sure you have a list a mile long, but since you seem to solicit user feedback, there's mine
    Thanks!
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Attaching a file to posting
    By Calvinsdad in forum FormMail Subscription Support
    Replies: 1
    Last Post: 21-Feb-2004, 02:18 AM
  2. POST form data as well as email
    By zippy in forum FormMail Subscription Support
    Replies: 20
    Last Post: 24-Jan-2004, 04:29 PM
  3. good_url
    By aloneranger in forum FormMail Subscription Support
    Replies: 5
    Last Post: 21-Jan-2004, 06:30 PM
  4. GOOD_URL COMMAND IN FORMMAIL.PHP
    By Paul Ovens in forum FormMail Subscription Support
    Replies: 3
    Last Post: 19-Jan-2004, 04:29 AM
  5. not seeing form data
    By brownie in forum FormMail Subscription Support
    Replies: 6
    Last Post: 19-Jan-2004, 01:37 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
  •