|
Posted by Sentinel on 10/07/05 10:52
Joseph Melnick 06.10.2005 20:25:07 <PM6dndpb8eqZ8djeRVn-vw@rogers.com>
jmelnick@jphp.com alt.php Joseph
> Sentinel Wrote,
> "Sentinel" <support@elma.hr> wrote in message
> news:xn0e862m85awg1001@news.t-com.hr...
> > How do i create cookies with php?
> > allso, how can i read cookies and eventualy delete them?
> >
> > i have created a pool and the problem is that anyone can vote until
> > their finger gets tired and i want to prevent then from voting more
> > then once.
> >
> > i found a script on google but it doesn't work (eather id doesn't
> > create a cookie, or it can't read the cookie)
> >
> > the main thing is thet on one page there will be several pools and i
> > have to be able to create a cookie for each one seperatly.
> >
> >
> > Thanks
> >
> > --
> > Will work for bandwidth!
> rather than simply recording a vote response I advise that you record
> more the vote subject or id, vote response, timestamp, IP address,
> and cookie value (if available), a validity flag (default: Y)
>
> Store all these values in a database table.
>
> validity flag can be an arbitrary value Y or N
>
> create a maintenance script that can check your data and mark
> duplicates flag as N when following cases are true.
> case 1: consecutive rows where previous row has same values for vote
> subject or id, response, IP and cookie value if set.
> case 2: vote subject or id, response, IP and cookie value if set more
> than once per day..hour..10 minutes
>
> you could also dynamically generate an image with a code and force
> your users to enter the code into the vote entry form.
>
> This would also be added to your table codegen,coderesponse and
> your maintenance script would make rows N where these values do not
> match.
>
> These would certainly give you better vote results.
>
> Joseph
here is the table structure:
first table
pool id
pool name
pool question
pool votes
start date
end date
second table
answer id
pool id
answer
votes
vote once per pool
on the same page there could be several pools (depending on the start
and end date) and when voted i wanted to store pool id in a cookie -
then whei i actualy want to print a pool on the page i do this
read from db
loop
if cookie exist (with the pool id)
print pool results in a table
else
print pool in a table
end loop
that should be enough
--
Will work for bandwidth!
[Back to original message]
|