• Hello!

    I am using the code below for downloading of my files.


    <?
    define('WP_USE_THEMES', FALSE);
    require('../../../wp-blog-header.php');
    $query=mysql_query("SELECT * FROM $downloadCounter_table WHERE id = '".addslashes($_GET[id])."'");
    if (mysql_num_rows($query)) {
    $row=mysql_fetch_array($query);
    mysql_query("UPDATE $downloadCounter_table SET downloads = downloads + 1 WHERE id = '".addslashes($_GET[id])."'");
    if (!dCounter_broken($row[file],1)) { header("location: $row[file]"); }
    else { header("location: ".get_option(siteurl)); }
    }
    else { header("location: ".get_option(siteurl)); }
    ?>

    What I want to know is how I could edit it so that only registered users will have access to the files.

    Thank you.

The topic ‘Download restriction’ is closed to new replies.