View Single Post
  #1  
Old 13th December 2012, 16:43
sharpie sharpie is offline
Senior Member
 
Join Date: Apr 2012
United Kingdom
Posts: 17
Default userid in with passkey announce.php
How do i tie the passkey to the user id in this piece of code without the userid anyone can get hold of a passkey and use it

so basically when a user downloads it checks the userid and passkey are the same for that user so for example

userid=5 passkey=12345 << system checks both id and passkey can download

userid=6 passkey=12345 << system checks both id and passkey blocks download because passkey is different to that user in database


Code:
$rz = mysql_query("SELECT id, uploaded, downloaded, class, downloadpos, enabled, parked FROM users WHERE enabled = 'yes'". (ENA_PASSKEY ? "AND passkey=$passkey ":''). "ORDER BY last_access DESC LIMIT 1");

if ($MEMBERSONLY && mysql_num_rows($rz) == 0)

err("Unknown passkey. Please redownload the torrent from $BASEURL.");
Thanks
Reply With Quote