You are here: Re: Reading a cookie « PHP Programming Language « IT news, forums, messages
Re: Reading a cookie

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация