Page 1 of 1

Setting up a php and htaccess script

Posted: Mon Mar 24, 2008 2:29 am
by DJP1986
Hello everyone!

I am setting up a system where I have a directory of renders (pre-cut images for graphics) and I do not want them accessible to anyone who is not a member of the premium usergroup on my vBulletin forum. I used a htaccess script of "Order Allow, Deny" to make the directory completely unaccessible. I'm sure my error lies in here, but I'm not sure.

I used the following code on the page that will allow the user to download the files from:

Code: Select all

<?php 
if ($vbulletin->userinfo['usergroupid'] == '6' ) 
    { 
    echo "Welcome to the premium section!"; 
             } else { 
             echo "You do not have permission for this page"; } 
    ?> 
 
<a href="Avatars.rar">A</a>
And when I load that page in my main page using a php include, it doesn't let me download the rar file. Do I have to include some type of php code inside of the htacces? Or did I mess up my coding? Also, is there a way to detect if the user is a secondary member of that usergroup?

Thanks in advance for any and all help! :)

Re: Setting up a php and htaccess script

Posted: Mon Mar 24, 2008 5:54 am
by anto91
The .htaccess is denying access to the archive.rar