Title: $_SESSION Variable in hidden field
Last modified: September 5, 2017

---

# $_SESSION Variable in hidden field

 *  Resolved [ftpsportallianz](https://wordpress.org/support/users/ftpsportallianz/)
 * (@ftpsportallianz)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/_session-variable-in-hidden-field/)
 * Hello, i try to get the $_SESSION[‘saz’] Variable in the value of the hidden 
   field function.
    But it never give me the right feedback or no feedback.
 * What code i need for the value?
 * I know that the varibale ist there, for example 4567. I get the feedback outside
   the form.
 * I Try many things.
 * <?php $_SESSION[‘saz’]; ?>
 * <?php echo $_SESSION[‘saz’]; ?>
 * <?php echo $saz; ?> $saz = $_SESSION[‘saz’];
 * SESSION:saz
 * echo $_SESSION[‘saz’]
 * and so on. Nothing works.
 * Can anyone help me please! You see i’m not an programmer or coder. But it is 
   the last piece of my puzzle 🙂
 * THX!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/_session-variable-in-hidden-field/#post-9472181)
 * Hello,
 * Can you please clarify what you’re trying to achieve?
 * Unfortunately, we cannot provide support for custom coding.
 * Regards,
 *  Thread Starter [ftpsportallianz](https://wordpress.org/support/users/ftpsportallianz/)
 * (@ftpsportallianz)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/_session-variable-in-hidden-field/#post-9474081)
 * i wanna save an ref code in the hidden field. Like [http://www.website.de/?ref=1234](http://www.website.de/?ref=1234)
 * This Code i want to put in the hidden field with ultimate member. I put the ref,
   called ‘saz’ on my side, in a $_SESSION[‘saz’]; with this code
 * <?php
    $saz = $_SESSION[‘saz’];
 * if(isset($_SESSION[‘saz’]) && $_SESSION[‘saz’]) {
 * } else {
    $_SESSION[‘saz’] = $_GET[‘saz’]; }
 * So i can get the $_SESSION on every side an wont be lost. But if the member want
   register then should the hidden field take this as value.
 * Thx!
 *  Thread Starter [ftpsportallianz](https://wordpress.org/support/users/ftpsportallianz/)
 * (@ftpsportallianz)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/_session-variable-in-hidden-field/#post-9474907)
 * Andthis ist the default hidden field function from the UM Website.
 * I put it in the UM/core/action/register.php
 * dd_action(‘um_after_register_fields’, ‘add_a_hidden_field_to_register’);
    function
   add_a_hidden_field_to_register( $args ) { echo ‘<input type=”hidden” name=”ref_id”
   id=”ref_id” value=”<?php echo $_SESSION[‘saz’] ;?> ” />’; }

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘$_SESSION Variable in hidden field’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

## Tags

 * [$_session](https://wordpress.org/support/topic-tag/_session/)
 * [hidden](https://wordpress.org/support/topic-tag/hidden/)

 * 3 replies
 * 2 participants
 * Last reply from: [ftpsportallianz](https://wordpress.org/support/users/ftpsportallianz/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/_session-variable-in-hidden-field/#post-9474907)
 * Status: resolved