Help with approach...

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 11-17-2003
Geoff Berrow
 
Posts: n/a
Default Re: Help with approach...

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/
Reply With Quote
  #12 (permalink)  
Old 11-17-2003
FLEB
 
Posts: n/a
Default Re: Help with approach...

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
Reply With Quote
  #13 (permalink)  
Old 11-17-2003
Disco Plumber
 
Posts: n/a
Default Re: Help with approach...

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.
Reply With Quote
  #14 (permalink)  
Old 11-17-2003
Geoff Berrow
 
Posts: n/a
Default Re: Help with approach...

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/
Reply With Quote
  #15 (permalink)  
Old 11-17-2003
Disco Plumber
 
Posts: n/a
Default Re: Help with approach...

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.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:04 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0