restrict browse access to folder by php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mishrarajesh44
    New Member
    • Nov 2007
    • 23

    #1

    restrict browse access to folder by php

    hiii,
    i want to know , is there any script in php to restrict browse access to a folder
    because it would b helpful a lot..
    if anyone know please help me..
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by mishrarajesh44
    hiii,
    i want to know , is there any script in php to restrict browse access to a folder
    because it would b helpful a lot..
    if anyone know please help me..
    Be more specific. Are you asking about a page where only registered members can access?

    Comment

    • mishrarajesh44
      New Member
      • Nov 2007
      • 23

      #3
      Originally posted by markusn00b
      Be more specific. Are you asking about a page where only registered members can access?
      no i mean is there any program so that .,,in the browser by specifying the folder's path, it will not display the files it contains & gives message " restricted acces "

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by mishrarajesh44
        no i mean is there any program so that .,,in the browser by specifying the folder's path, it will not display the files it contains & gives message " restricted acces "
        Oh i see!

        You can use a .htaccess file and then specify the file and you can redirect the browser to a specific other page e.g. restrictedacces s.php

        :)

        Comment

        • maheswaran
          New Member
          • Mar 2007
          • 190

          #5
          Hi ,
          Use like this

          RewriteEngine on
          RewriteRule ^log.txt$ $
          RewriteRule ^ContactusFile. txt$ $

          specify like above example, save this file as .htaccess

          Comment

          • mishrarajesh44
            New Member
            • Nov 2007
            • 23

            #6
            Originally posted by maheswaran
            Hi ,
            Use like this

            RewriteEngine on
            RewriteRule ^log.txt$ $
            RewriteRule ^ContactusFile. txt$ $

            specify like above example, save this file as .htaccess
            thanks for reply..i will try it..

            Comment

            • jd1698
              New Member
              • Oct 2012
              • 1

              #7
              did this work for u?

              Originally posted by maheswaran
              Hi ,
              Use like this

              RewriteEngine on
              RewriteRule ^log.txt$ $
              RewriteRule ^ContactusFile. txt$ $

              specify like above example, save this file as .htaccess
              Hi

              I writing a system for a dozen users they each have their own login area and I want them to be able to upload files they have in their /usr/name folder into a common area and not see other folks' efforts
              so I've got this in php

              printf ('<tr> <td> <label for="uploadFile ">File to upload </label> </td>');
              printf('<td> <input type="file" name="uploadFil e"> </td> </tr> ');

              I created the above suggestion using ' vi .htaccess ' and put the file in /opt/lampp/htdocs but then when I press browse I can see all of the files on the system.

              any help appreciated

              Jim

              Comment

              Working...