I have a file hosting site where users can upload and download files. The download link makes everybody wait 30 seconds before it starts automatically downloading.
I want to make it so users who are logged in (through a previously coded login system) do not have to wait the 30 seconds.

I was told to put this code

<?PHP

 if(isset($_COOKIE["Your_User_Cookie"]))
{
    header("Location:/download.php?action=2&file=FILE_NAME");
}
else
{
    // do normal 30s meta refresh
}

?>

in my download template but as it is a template it won't recognize the php codes in there.

Any help?

Thanks in advance

    Just another reason not to use templating systems.
    Instead of the header() call you might want to add another meta refresh this time with a smaller time out of say 0 or 1 seconds.

    --
    The Case Againsts Templates

      How would i do that though since the download.php is looking for a template and i can't add php to the template..

      also, the cron job gives me this error
      read_config_store open failure on /var/net-snmp/snmpapp.conf

      suggestions anyone?

        Write a Reply...