[TYPO3] session/form variables in typo3

Matthew Manderson matthew at manderson.co.uk
Mon Sep 4 14:49:22 CEST 2006


> I am quite new to Typo3 and was wondering if it's possible to develop a
> site that uses session and form variables to pass information over a few
> pages, nothing complex just passing some information to a contact form.

Karl

Sorry for the late reply.

The way I manage this is to start with a series of pages nested inside each
other like this:

page1
  |--page 2
       |--page 3
            |--page 4 etc...


This cascade allows you to use a path navigation that looks great for the
idea of a path.

Otherwise just do this:

page1
  |--page 2
  |--page 3
  |--page 4 etc...


In each page I add an ext template and use a simple USER or USER_INT to the
external function like this:

page.10.subparts.phpscript.userFunc = user_phpScriptGlobal->addToCart

Each page calls the next function etc.

Now to pass the data between the forms I usually use one of two ways.

1) To just store everything in a $_SESSION[]
2) To pass store everything as POST.

Remember if you use POST to grab the POST from the earlier page and use a 
foreach loop to output the hidden <input fields so the data can be passed
to the next page.

If you add your error checking to the second page you can just send people
back to the referer if any fields are not found that should be. I try to
avoid javascript unless it reduces field errors or improves usability.

HTH you or someone else.

Matthew






More information about the TYPO3-english mailing list