help me for this bugs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    help me for this bugs

    i use this htaccess in my site

    Code:
    RewriteRule w_(.*)\.html$ /index.php?dir=$1
    RewriteRule file_(.*)\.html$ /file.php?file=$1
    
    RewriteRule wx_(.*)_(.*)\.html$ /index.php?dir=$1&page=$2
    And the problem is when i upload a file that has a _ in its filename it will cause the error when i tried to click that uploaded file..error is redirect to main page..but the rest file is n0t a pr0blem...help please...

    #2
    just simply use base64_encode($filename)

    Comment


      #3
      Originally posted by timo View Post
      just simply use base64_encode($filename)
      But how bro?can i add that in htaccess?

      Added after 3 minutes:

      i think it only fix in htaccess but im n0t expert in that
      Last edited by hi_jakkk; 05.10.12, 10:35.

      Comment


        #4
        Originally posted by hi_jakkk View Post
        But how bro?can i add that in htaccess?

        Added after 3 minutes:

        i think it only fix in htaccess but im n0t expert in that
        in your php code simple replace your href with this
        PHP Code:
        <a href="./file_'.base64_encode($filename).'.html">'.$filename.'</a
        in download php code you should decode that
        PHP Code:
        $file base64_decode($_GET['file']); 
        thats it!

        OR

        in your htaccess
        RewriteRule file_(.*)\.html$ /file.php?file=$1 <=(you have to change this because it conflict with the filename because of underscore sign)

        RewriteRule file=(.*)\.html$ /file.php?file=$1


        OR

        in upload php code

        PHP Code:
        $filename $_FILES["uploaded"]['name'];

        $filename str_replace("_",""$filename); 

        Comment

        Working...
        X