+ Reply to Thread
Results 1 to 3 of 3

Thread: session variables in fmbadhandler

  1. #1
    tsrwebmaster Guest

    Default session variables in fmbadhandler

    is it possible to access the session variables in the error template?
    if so how?

    Or -can I at least access the $this_form and $return_link variables

    Any help very much appreciated

    Thanks in advance

    Allan

  2. #2
    tsrwebmaster Guest

    Default Re: session variables in fmbadhandler

    I have:
    In my form -
    Code:
    $SESSION_NAME = "tsremail";     // if you're using a particular name for your session, specify it here.
    if (!empty($SESSION_NAME))
     session_name($SESSION_NAME);
    session_start();
    $_SESSION['baseref']=$baseref;
    ....
    ...... (html headers are here)
    .....
    In formmail, fmbadhandler and verifyimage -
    Code:
    $SESSION_NAME = "tsremail";     // if you're using a particular name for your session, specify it here.
    if (!empty($SESSION_NAME))
     session_name($SESSION_NAME);
    session_start();
    in errrortemplate -
    Code:
    echo "dummy <br />";
    $SESSION_NAME = "tsrmail";     // if you're using a particular name for your session, specify it here.
    if (!empty($SESSION_NAME))
     session_name($SESSION_NAME);
    session_start();
    .....
    ......(html headers are here)
    ......
    while (list ($key, $val) = each ($_GET)) { 
    echo "$key -> $val <br>"; 
    }
    echo "dummy <br />";
    echo $SESSION_NAME."<br >";
    echo "dummy <br />";
    while (list ($key, $val) = each ($_SESSION)) { 
    echo "$key -> $val <br>"; 
    }
    echo "dummy <br />";
    When loaded errorrtenplate displays -
    dummy
    USER_AGENT -> Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)
    sessid -> 76f61a10aa550b81d67b9f1f1c947d2a
    dummy
    tsrmail
    dummy
    dummy
    The URL displayed when errortemplate is loaded is
    the value for $_SESSION['baseref'] is not carried forward -
    have I missed something?

    help appreciated

    Allan

  3. #3
    Join Date
    Apr 2008
    Posts
    23

    Default Re: session variables in fmbadhandler

    Hey there ---

    Here's something I did.

    My form is a .php file, let's call it myform.php.

    I set bad_url to go back to the form url itself.

    Then in the form I do a "session_start()" and then "print_r($_SESSION)"

    Here's what I got:

    Code:
    Array
    (
        [FormError] => The form required some values that you did not seem to provide. 
        [FormErrorInfo] => Company_Name
    Contact_Name
    Phone
    Shipping_Address
    
        [FormErrorCode] => missing_fields
        [FormErrorItems] => Array
            (
                [0] => Company_Name
                [1] => Contact_Name
                [2] => Phone
                [3] => Shipping_Address
            )
    
        [FormIsUserError] => 1
        [FormAlerted] => 1
        [FormData] => Array
            (
            )
    
    )
    I imagine the vars you're looking for may be in the [FormData] Array.

    Or maybe you've solved your problem already and moved on In any case, thought I'd post that here in case it helps someone else.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Return All Variables To Form Page On Error
    By cornernote in forum FormMail Subscription Support
    Replies: 12
    Last Post: 31-Oct-2004, 10:20 PM
  2. Removing empty variables from eMail reply
    By Prospero in forum FormMail Subscription Support
    Replies: 4
    Last Post: 25-Jul-2004, 08:22 AM
  3. Environment Variables
    By Goji in forum FormMail Subscription Support
    Replies: 1
    Last Post: 22-Jul-2004, 03:39 AM
  4. Return All Variables To Bad_Form Page On Error
    By vladimir in forum FormMail Subscription Support
    Replies: 2
    Last Post: 07-Jun-2004, 06:13 PM
  5. Adding Attachment Variables
    By Bella in forum FormMail Subscription Support
    Replies: 1
    Last Post: 12-Apr-2004, 10:43 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