PHP - Moved: Restrict Access To Subfolder / .htaccess
This topic has been moved to Apache HTTP Server.
http://www.phpfreaks.com/forums/index.php?topic=357293.0 Similar TutorialsI have solved this now. Hi guys, in my database i have the table called users, where i have 5 fields (id, username, email, password, user_level) - for the user_level field i have 2 options administrator and editor.
What i want to do is that when the user who is logged in have administrator in the user_level field to see all the pages from backend, and the user who have in the user_level field editor to see only some of the pages from the backend such as newsletter, or messages.
I hope you understand what i'm asking if not fell free to ask me if you need more specific details.
I tried to make a php page called access.php wher i put the following code, but not working
<?php session_start(); $sql = $mysqli->query("SELECT user_level FROM imobiliare_users WHERE id=$id"); $user_level = $mysqli->query($sql); echo $user_level; if ($user_level !="administrator") { echo "You are not the proper user type to view this page"; die(); } ?>Hope you can help me. Thx in advance for help. hi all i am using this below code in htaccess RewriteCond %{HTTP_REFERER} !^http://(.+\.)?domain\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule .*\.(jpe?g|bmp|png|swf)$ /images/nohotlink.gif [L]Also I am using colorbox script to show content in popup. I have some images in "images" folder inside "colorbox" folder on the root on local server (xampp) The above code in htaccess file is not showing "images" from this images folder that is inside colorbox folder on root on local server (xampp) If i comment those 3 lines in htaccess file then all images are shown fine on local server (xampp). How can i allow my htaccess file to show these images from inside colorbox folder on local server (xampp)?? Thanks Vineet I have around 14 script files for an admin page.
I am looking to block the access to 10 of them with .htaccess, so they can not get called up through the URL with the web browser, by for example guessing the name.
<Files index.php> Order Allow,Deny Allow from all </Files>How to set up, so I can have "those" 10 files in there? Also, when comes to having an admin page and blocking the access to "those" script files is this the proper way to do it? I would appreciate the suggestions a lot! Edited by glassfish, 25 October 2014 - 11:06 AM. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=351154.0 This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=332517.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=349238.0 This topic has been moved to Apache HTTP Server. http://www.phpfreaks.com/forums/index.php?topic=306351.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=318730.0 This topic has been moved to Apache HTTP Server. http://www.phpfreaks.com/forums/index.php?topic=333684.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=314407.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=356252.0 This topic has been moved to Apache HTTP Server. http://www.phpfreaks.com/forums/index.php?topic=342523.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=333386.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=353241.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=342235.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=349451.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=306379.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=321972.0 This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=310649.0 |