View Single Post
Join Date: Aug 2007
Posts: 73
Reputation: smartness is an unknown quantity at this point 
Solved Threads: 10
smartness's Avatar
smartness smartness is offline Offline
Junior Poster in Training

Re: Create a script that checks if "file.txt" is chmoded 777, and if mod_rewrite = on

 
0
  #3
Jan 5th, 2009
You can check the Permissions of a file like this
Create a file called test.php
add the code below to test.php
  1. <?php
  2. echo substr(sprintf('%o', fileperms('latest.txt')), -4);
  3. echo '<br>';
  4. echo substr(sprintf('%o', fileperms('count.txt')), -4);
  5. echo '<br>';
  6. echo substr(sprintf('%o', fileperms('comments.txt')), -4);
  7. ?>
Can you help me on Echoing error message for each file if not writeable, or echo a Other Message if writeable

I found the cURL check function:
<?php

if (!function_exists('curl_init'))
echo "OK";


elseif (function_exists('curl_init'))
echo "Curl is installed";


?>
Reply With Quote