please help me again

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    please help me again

    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

    #2
    without using database:
    PHP Code:
    if($_COOKIE["filedata"]<time())
    {
       echo 
    "download link";
    }
    if(!
    $_COOKIE["filedata"]) //save cookie being updated to new 
    {
         
    $day time()+86400;
        
    setcookie("filedata"$day$day);

    Last edited by something else; 29.02.12, 18:07.

    Comment


      #3
      Originally posted by something else View Post
      without using database:
      PHP Code:
      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 :D)

      Final edit :D
      Last edited by softwarefreak; 29.02.12, 18:15.
      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

      Comment


        #4
        i did a slight edit to it afterward lol

        Comment


          #5
          My small edit of somthing's code
          PHP 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

          Comment

          Working...
          X