WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Guidance for a multiple part form with $_SESSION in WordPress (1 post)

  1. Sennza Pty Ltd
    Member
    Posted 3 years ago #

    Hey guys and gals,

    I was hoping for a bit of guidance with a plugin for a project that I'm working on at the moment. I have to make a 4 part form for a client that will have a stack of fields and also 'Next' and 'Back' buttons. The form will be shown on a few pages on the theme each with different page templates that hold the form code. e.g. Template Name: Form 1, Template Name: Form 2, etc.

    Normally in php I'd create a session and store the data in that until the final part of the form where I'd sanitise the data and process it provided it's passed any validation required.

    Now as WordPress appears to be stateless is there another way that I should go about doing this?

    I've managed to hack my way through it by passing variables through hidden values and $_GET requests but I'd like to alter that to a $_SESSION if possible so I can clean up my code.

    I have read some posts from people on a few blogs with a similar problem and some of them have mentioned modifying load.php and changing the $no_unset array to include '_SESSION' as well. Touching core files doesn't sit right with me as I'm sure that I'd have to fix that up in future upgrades.

    Could anyone give me some guidance, albeit it advice or a few links to blog posts with some advice?

    Thanks heaps! :)

Topic Closed

This topic has been closed to new replies.

About this Topic