|
Posted by Jerim79 on 02/06/07 15:22
On Feb 6, 9:03 am, "P Pulkkinen"
<perttu.POISTATAMA.pulkki...@POISTATAMA.elisanet.fi> wrote:
> "Jerim79" <m...@hotmail.com> kirjoitti
> viestissä:1170773276.017695.162...@v45g2000cwv.googlegroups.com...
>
> > What I am trying to accomplish is to have a script that opens a
> > cookie, reads a value, and then use a switch/case to take action based
> > on that value in the cookie. I want to set the cookie manually, so I
> > don't need setcookie(). I see that in PHP it stores the cookie in
> > memory. Is there a way to have PHP just read a cookie from the desktop
> > machine? Does it have to set it first? Am I better off with Javascript
> > for this?
>
> I hope i don't miss some point, but generally speaking:
>
> 1) On page #1 EITHER php during the page rendering OR client javascript
> anytime, even later, SETS UP a cookie.
> 2) Person clicks a link submits a form to MOVE ON to page #2 on same domain.
> 3) On page #2 EITHER php OR client javascript READS that cookie and have
> some fun with it (does it's thing).
>
> Of course even both can set cookies and have fun together, but that' not the
> point.
>
> No comments on the final problem, but somehow i felt that this needed to be
> written to clarify.
Not exactly.We will have a simple registration form that a customer
fills out at a kiosk. They click submit and the customer is done. From
there the registration info is sent to a PHP script which first opens
a cookie on the client computer and reads the value. Next, it runs
through a list of switch/case statements based on that value to
determine which printer the client computer is using and what format
it needs to print in (This is for remote printing, to one of four
possible printers). This way, when we move a computer to a different
printer, we just change the value in the cookie and it starts printing
correctly. (We are using a remote server for the data collection, and
local PC to print.)
Since each printer is different, the setcookie() method would not
work because it can only set one value across four machines (Unless we
did four different scripts, which would get confusing). We need to be
able to have four different values for the same cookie. We also need
to be able to manually change the value when the computer moves. Think
of a file that you create on four different computers. Each file has
the same name, but a different letter in it; A, B, C or D. The program
opens the file up on each computer, reads in A, B, C or D. Then it
takes action on whether the file contained A, B, C or D. That is what
we are trying to accomplish with cookies. We don't want to create the
file each time the program runs, because the file is already there.
[Back to original message]
|