Setting up a php and htaccess script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DJP1986
Forum Newbie
Posts: 1
Joined: Mon Mar 24, 2008 2:25 am

Setting up a php and htaccess script

Post 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! :)
anto91
Forum Commoner
Posts: 58
Joined: Mon Mar 10, 2008 10:59 am
Location: Sweden

Re: Setting up a php and htaccess script

Post by anto91 »

The .htaccess is denying access to the archive.rar
Post Reply