Connecting Tech Pros Worldwide Forums | Help | Site Map

block ratimg for second time

pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 424
#1: 3 Weeks Ago
hii guys,
I have done a rating site . where in the guest is also allowed to rate .

I wanted to know which is the best way so that the same guest user he does not rate it second time .
If i block using the Ip address,problem is that they might be using proxy .
how do i do a time block say agin after some time only he rates again.

or is there any better solution for this !

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,684
#2: 3 Weeks Ago

re: block ratimg for second time


what about a cookie?
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 424
#3: 3 Weeks Ago

re: block ratimg for second time


can u brief about this technique plz!! how to do it!
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,684
#4: 3 Weeks Ago

re: block ratimg for second time


cookies
cookies @ php.net
cookies @ w3schools.com
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 424
#5: 3 Weeks Ago

re: block ratimg for second time


what if the user has blocked the cookies. can we do this using sessions??
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,684
#6: 3 Weeks Ago

re: block ratimg for second time


of course you can use sessions. (though they also use cookies)
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 424
#7: 3 Weeks Ago

re: block ratimg for second time


i mean to say when the mysql add function is executed a session variable is set and after some time say 2 minutes destroy/unset the session variable !so that the user can rate after 2 minutes . is this a gud idea?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,684
#8: 3 Weeks Ago

re: block ratimg for second time


doesn’t sound bad…
______________
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 424
#9: 2 Weeks Ago

re: block ratimg for second time


i did the way i talked about with u !! but when the browser gets closed once and again opened the rating gets opened up ..how to prevent this ..
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,684
#10: 2 Weeks Ago

re: block ratimg for second time


I don’t know, how you set the session cookie…
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 424
#11: 2 Weeks Ago

re: block ratimg for second time


Expand|Select|Wrap|Line Numbers
  1.   $_SESSION['rated'] = 'yes';
  2.                 $_SESSION['brand'] = $brand;
  3.                 $_SESSION['model'] = $model;
  4.                 $_SESSION['extime'] = time() + 360;
  5.  
i was just setting few variable as session variables and checking for these values when the page loads !!!
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,684
#12: 2 Weeks Ago

re: block ratimg for second time


Quote:

Originally Posted by pradeepjain View Post

Expand|Select|Wrap|Line Numbers
  1. $_SESSION['extime'] = time() + 360;
  2.  

is irrelevant if your session cookie is destroyed when the browser is closed.
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 424
#13: 2 Weeks Ago

re: block ratimg for second time


okie ! i am not much experienced with sessions and cookies!
can u plz tell me how to do it !!i have told u ma logic !!!
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,684
#14: 2 Weeks Ago

re: block ratimg for second time


looks like you have to modify the session.cookie_lifetime variable. see Session Runtime Configuration
Reply