This may be a stupid question, but I'm trying to set up a system where I
can
take a poll from visitors to my website and then set a cookie so that they
can't vote more than once (until they clear their cookies at least).
Problem is, I don't want to put it at the top of my page, because what if
--- Liam Gibbs [EMAIL PROTECTED] wrote:
Does it have to be a cookie? I use the IP address and store
that somewhere.
Please don't. An IP address is a terrible means of user identification.
I would explain why, but I think it would be more informative to search through
the archives, as previous
Hello,
This is a reply to an e-mail that you wrote on Sun, 10 Aug 2003 at
00:24, lines prefixed by '' were originally written by you.
This may be a stupid question, but I'm trying to set up a system
where
I can
take a poll from visitors to my website and then set a cookie so
that
they
can't
On Sunday, August 10, 2003, at 01:36 PM, Liam Gibbs wrote:
Does it have to be a cookie? I use the IP address and store that
somewhere.
Liam, please don't advise relying on the IP address for anything. It's
been discussed to death on the list before, but in short, the
highlights are:
1.
Assuming that you have a process page that stores the submitted choice, have
the process page make the cookie setting and then redirect back to the first
page.
Or better yet, I like it when my original page never leaves and a popup
window is openned to save my choice and then show me the results
There are two ways round your problem...
1. Set your cookie right at the top of the script, so as your first line
have something like: if(isset($_POST['vote'])){ setcookie(); }
2. Use output buffering, this will make PHP buffer all of your content
and not send it till you tell it to (or
6 matches
Mail list logo