# Custom php code in stacks, using session variables in stacks forms

**URL:** <https://forums.realmacsoftware.com/t/custom-php-code-in-stacks-using-session-variables-in-stacks-forms/2691>\
**Category:** RapidWeaver Classic\
**Created:** [September 20, 2015, 1:17am UTC](https://forums.realmacsoftware.com/t/custom-php-code-in-stacks-using-session-variables-in-stacks-forms/2691 "2015-09-20T01:17:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eduardo](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/eduardo/32/972_2.png) [@eduardo](https://forums.realmacsoftware.com/u/eduardo)\
**Post date:** [September 20, 2015, 1:17am UTC](https://forums.realmacsoftware.com/t/custom-php-code-in-stacks-using-session-variables-in-stacks-forms/2691/1 "2015-09-20T01:17:06Z")

</div>

Does anybody know how to include php code in stacks, for example to display session variables, and how to include session variables values into form fields ?

Many thanks in advance

Eduardo

---

<div class="post-metadata">

**Author:** ![isaiah](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/isaiah/32/93_2.png) [@isaiah](https://forums.realmacsoftware.com/u/isaiah)\
**Post date:** [September 20, 2015, 1:41am UTC](https://forums.realmacsoftware.com/t/custom-php-code-in-stacks-using-session-variables-in-stacks-forms/2691/2 "2015-09-20T01:41:55Z")

</div>

there are a number of ways, but the simplest is to add an HTML stack and put your php in there. remember to rename the page with a “.php” extension so that your web server will process the php inside of it.

other ways:

Stacks works very much like other parts of RapidWeaver. A Text stack works just like a Styled Text page. If you want to add php to a Styled Text page (or Text stack) you can add the php, select it, and choose the menu option: Format \> Ignore Formatting

HTML Stacks work just like HTML pages – and should except php too.

And Markdown Stacks and Markdown pages are really just accept all HTML too – so they’ll work with php too.
