This is a discussion on Help with approach... within the PHP Language forums, part of the PHP Programming Forums category; I noticed that Message-ID: <e%0ub.10667$bg.3912@newssvr29.news.prodigy.com> from Martin Euredjian contained ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I noticed that Message-ID:
<e%0ub.10667$bg.3912@newssvr29.news.prodigy.com> from Martin Euredjian contained the following: >Say I'm using PHP to handle navigation and want to (obviously) store at >least a state variable somewhere in order to keep track of what's going on. > >How are these variables persisted? >Do they cross html page boundaries? Yep, you need to use sessions. See my session demo: www.ckdog.co.uk/php/color.php -- Geoff Berrow (put thecat out to email) It's only Usenet, no one dies. My opinions, not the committee's, mine. Simple RFDs http://www.ckdog.co.uk/rfdmaker/ |
|
|||
|
On Mon, 17 Nov 2003 10:00:42 GMT, Martin Euredjian wrote:
(-- snip --) > Questions: > > Say I'm using PHP to handle navigation and want to (obviously) store at > least a state variable somewhere in order to keep track of what's going on. > > How are these variables persisted? > Do they cross html page boundaries? > > I use state machines extensively in my normal line of work (embedded, > hardware, firmware, software design). Is this technique in use to drive > websites? If so, where is the state machine code contained so that it can > control the whole site? On the surface it sounds like PHP could be used > this way. > > Maybe a set of variables are declared/used in the index.htm for the site and > they retain visibility for all other pages... > > Thanks, > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Martin Euredjian > > To send private email: > 0_0_0_0_@pacbell.net > where > "0_0_0_0_" = "martineu" You'll want to look at "PHP Sessions" (English docs at http://www.php.net/manual/en/ref.session.php ). I don't know much about it myself, but, as far as I know, PHP sessions are basically an automated method of using cookies and special modified links to keep an "identity" of a session, then keep all the variable values for that session. This can also be done the manual way, by simply making sure you pass on any relevant information from page to page using HIDDEN form entries, the GET portion of links (pagename.php?session=1929247 type URLs), or Cookies. Like any stateless language (where no single script implicitly remembers what came before it), you just have to make strategies for keeping the important info safe and available. -- -- Rudy Fleminger -- sp@mmers.and.evil.ones.will.bow-down-to.us (put "Hey!" in the Subject line for priority processing!) -- http://www.pixelsaredead.com |
|
|||
|
Geoff Berrow, doing a poor impression of Alexander Hamilton, said:
> > Yep, you need to use sessions. See my session demo: > www.ckdog.co.uk/php/color.php Do you have the source available? /joe -- A server from Gary Yngve is disappointing in the Curran Deck -OR- the monitor from Di will go to Jordan McKible in Havoc's "say". In the Masquerade, a monitor is disturbed. |
|
|||
|
I noticed that Message-ID: <bpao9g$hso$1@news-int2.gatech.edu> from
Disco Plumber contained the following: >> Yep, you need to use sessions. See my session demo: >> www.ckdog.co.uk/php/color.php > >Do you have the source available? Sure. http://www.ckdog.co.uk/php/color.phps http://www.ckdog.co.uk/php/page2.phps http://www.ckdog.co.uk/php/page3.phps -- Geoff Berrow (put thecat out to email) It's only Usenet, no one dies. My opinions, not the committee's, mine. Simple RFDs http://www.ckdog.co.uk/rfdmaker/ |
|
|||
|
Geoff Berrow, obviously a huge fan of Hilary Clinton, wrote:
> >>Do you have the source available? > > Sure. Thanks, I've been curious about sessions. Thus far, I've done all session-type stuff manually with db tables and cookies. /joe -- In City Cafe, the Gamecube from a crackwhore will go to Tim Faircloth. Erika codes a replacement for the Atlanta Diner for a cable modem, and then frequently ridicules the ~studly frat house from alexdata. |