|
Posted by Jerim79 on 02/07/07 17:32
On Feb 7, 11:21 am, Rik <luiheidsgoe...@hotmail.com> wrote:
> Jerim79 <m...@hotmail.com> wrote:
> > On Feb 7, 10:46 am, Rik <luiheidsgoe...@hotmail.com> wrote:
> >> Jerim79 <m...@hotmail.com> wrote:
> >> > Okay, so we are going with cookies. The problem I have is that I don't
> >> > know how to make PHP just read acookie.
>
> >> It's in the $_COOKIE array.
> >> --
> >> Rik Wasmus
>
> > I tried that and it doesn't seem to work. For instance:
>
> > <?php
>
> > switch ($_COOKIE["printer"]) {
>
> > case A:
> > echo "Hello";
> > break;
> > case B:
> > echo "Yes";
> > break;
> > case C:
> > echo "No";
> > break;
> > case D:
> > echo "Goodbye";
> > break;
> > }
> > ?>
>
> > That doesn't do anything.
>
> Do a var_dump($_COOKIE);
> If nothing is set, the browser probably did not send acookie, and you'll
> have to check wether thecookieyou're expecting is set correctly.
> --
> Rik Wasmus
Right, we don't want to set a cookie. EVER. We just want to READ a
cookie that we create manually, ourselves. (The goal here is to have
the PHP form read a cookie by the name of "printer." The value of
"printer" needs to be different on every machine. If PHP sets the
cookie, then "printer" would always have the same value and that
defeats the purpose. The only way "printer" will have a different
value on each computer, is if we create it manually on each machine.
We need a way for the PHP form to "identify" which kiosk computer it
is talking to.)
I know in javascript you can create a cookie manually and have
javascript read it. We want to do that in PHP.
Navigation:
[Reply to this message]
|