www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to hide file path using PHP

  1. #1
    Join Date
    Jan 2003
    Location
    Egypt
    Posts
    185

    Question How to hide file path using PHP

    Hi,
    I would like to ask about how to, randomly, hide a file path using PHP and what is the technical name of such process.

    For example:
    mywebsite.com/imgs/someuser/img.jpg
    to
    mywebsite.com/imgs/nddsfdsfgdfuu4923fdj3er982/img.jpg
    while the value nddsfdsfgdfuu4923fdj3er982 should be randomly changed every time the img.jpg is requested.

  2. #2
    Join Date
    Oct 2009
    Posts
    658
    Create a random salt and store it somewhere, db perhaps, then encode the parameter with the salt. Then use mod_rewrite to rewrite it in a form like mywebsite.com/imagehandler?f=img.jpg&e=<encoded parameter>Have imagehandler compare the parameter to your salt then spit out the object

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles