Jump to content

new_member

Members
  • Posts

    21
  • Joined

  • Last visited

new_member's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry the modified code is RewriteRule \.(pdf)$ - [NC,F,L] RewriteCond %{REQUEST_URI} \.(doc|zip|pdf)$ [NC] RewriteRule ^(.*)$ download.php?filename=$1 [L] But still it is giving restricted access if i access it from my site also.
  2. I have resolve the file download issue. Finalized code in htaccess is: RewriteEngine On # you can add whatever extensions you want routed to your php script RewriteCond %{REQUEST_URI} \.(doc|zip|pdf)$ [NC] RewriteRule ^(.*)$ download.php?filename=$1 [L] But it is causing the same problem again as if someone access the file without going through site it will open it. Any idea on how to prevent direct access to files
  3. preg_match("/[^\/]+$/", $_SERVER['HTTP_REFFERER'], $matches); //get the filename after last slash $file_name= $matches[0]; header("Content-disposition: attachment; filename=".$file_name); header('Content-Type: application/octet-stream'); readfile($file_name".pdf");
  4. I donot have any single which i am referencing. I have multiple files inside the subdirectory download_files and are reffered by multiple places in the site. I want to restrict all of these files so i have applied the above code in htaccess. Now, i am unable to understand where to put the download.php and how to pass the file name to that so that if someone accesses it through website he should have access to that. Please explain me the flow
  5. I want that if a file in accessed by directly copy paste the url in browser it should restrict its access and that is actually happening by adding the above lines in htaccess. But these lines are not allowing me to access the files even if i access them going through my website. I want the files to be accessible if i reach those files through my site. For this i have googled a lot but none of the code worked
  6. Hi, I want to restrict access to specific folder if some one copies and paste download file link or folder in browser. For that i have modified my htaccess file and added following lines of codes in that RewriteEngine On RewriteCond %{REQUEST_URI} \.(doc|zip|pdf)$ [NC] RewriteRule ^(.*)$ /download-pdf.php?filename=$1 [L] Beside this i have placed plenty of codes searcher from google to make it accessible when accessed from my domainsite.com http://stackoverflow.com/questions/19626322/deny-directly-access-to-folder-but-allow-throw-script http://stackoverflow.com/questions/13658988/prevent-direct-access-to-images-using-the-browser-url and searched almost every site. But restricting access to my files will not allow me to access it through my site also. The only solution i came across is to force download the restricted file if accessed through my site. For that i have made forcedownload.php file and reading the contents of file in that. But the problem is that how to add condition in htaccess to go to download page if accessed through my site. Any help??
  7. Hi, I want to use mysql dumper database. For that i have applied password protected encryption. Before it was giving 404 error but later on modifying the roor htaccess files by adding AuthName "MySQLDumper" AuthType Basic AuthUserFile "myfilepath" require valid-user or Errordocument 401 error.html Errordocument 403 error.html prompts for the user login. But on adding the login credentials it is taking to same window again and again asking for login info again. Any idea how to solve this??
  8. Hi, I want to know that how to impCross site script rejection using session id and agent hash key pair in yii. I have read many tutorials: http://htmlpurifier.org/live/smoketests/xssAttacks.php http://www.yiiframework.com/wiki/275/how-to-write-secure-yii-applications/#hh6 http://www.yiiframework.com/doc/guide/1.1/en/topics.security#cross-site-scripting-prevention But i am unable to understand where to implement it in yii using session id and agent key has pair. Any help??
  9. How to loop through this type of array? Array ( [0] => Array ( [test] => test1 [test2] => test2 ) )
  10. yes i have missed some quote while posting here. serialize($this->test['testing']) This is the complete code and array i have given above. Regarding foreach as i know how to use with one or two dimensional arrays but there is not any example that show to access the array of type i have given above thats why i am facing problems
  11. i know i have to use foreach but how to loop and access the content. I am unable to find this. For serializing i am just using serialize($this->['testing]) if i print $this->testing it gives me output [testing] => Array ( [0] => Array ( [test1] => test.com [test2] => test2 [test4] => test4 ) ) but serializing it gives null dont know why
  12. Hi, I want to know how to access the values of given array values using loop in php: Array ( [0] => Array ( [test1] => testval [test2] => testval2 ) i dont know what to loop and how to access it. Moreover if i am serializing the given array using php serialize function it is giving me output as N;. I dont know whats the problem with the serialize function of my code as i use serialize($this->['testing]); [testing] => Array ( [0] => Array ( [test1] => test.com [test2] => test2 [test4] => test4 ) ) Any help??
  13. I have used $dom = new DOMDocument(); $dom->loadHTML($file); $node = $dom->getElementById("registryData"); $output = $dom->saveHTML($node); echo $output; However i have used many other codes like this to parse the data within the html tages like anchor tags, img etc but i cannot find any way to find the language used.
  14. can you give me the example how to parse and get the language of site as well as defined in html tags. I am unable to do it I have used $html = file_get_contents(url of site) What to do next??
  15. I want to get it from any other site. I have Url's of multiple sites and using that i want to get these languages for each site
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.