please help me again

Started on the old forum in February 2012 · view the original in the archive · old links redirect here

#code

4 replies · 312 views · started 14 years ago · 1 min read

3 participants
Lue_chin Developer · 107 posts #1

hello experts and owner of site i want code that a person ip can visit only one day one time of a page for ex: if ip same then the file can not display and if new ip or ip next day come then the file shows

something else Fellow · 2,296 posts #2

without using database:

if($_COOKIE["filedata"]<time())
{
   echo "download link";
}
if(!$_COOKIE["filedata"]) //save cookie being updated to new 
{
     $day = time()+86400;
    setcookie("filedata", $day, $day);
}
softwarefreak Senior · 349 posts #3

something else wrote: without using database:

if($_COOKIE["filedata"]<time()) 
{ 
   echo "download link"; 
} 
if(!$_COOKIE["filedata"]) //save cookie being updated to new  
{ 
     $day = time()+86400; 
    setcookie("filedata", $day, $day); 
}  

very nice for a script where security ain't dat imp, thanks,it came to my mind lately(after I saw the post 😀)

Final edit 😀

I need some facebook likes, can you please help me 🤝 http://facebook.com/softwarefreakin I noticed social media is really powerful 🧙 Well DONE is better than well SAID

softwarefreak Senior · 349 posts #5

My small edit of somthing's code

<?php
if(isset($_COOKIE["filedata"]) && $_COOKIE["filedata"]>time())  
{
	echo "Come back tomorrow for another cookie :P";  
}  
else
{
	
     $day = time()+86400;  
    setcookie("filedata", $day, $day);  
   echo "download link";    
}  
?>

I need some facebook likes, can you please help me 🤝 http://facebook.com/softwarefreakin I noticed social media is really powerful 🧙 Well DONE is better than well SAID

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close