Difference between revisions of "PHP"

From Blue-IT.org Wiki

(Created page with "== Test, if a file can be written to directory == <?php $handle = fopen("/tmp/test.txt", "x"); if ($handle) echo "Success!"; else print_r(error_get_last()); ?>")
 
 
Line 1: Line 1:
 
== Test, if a file can be written to directory ==
 
== Test, if a file can be written to directory ==
  
<?php
+
<?php
$handle = fopen("/tmp/test.txt", "x");
+
$handle = fopen("/tmp/test.txt", "x");
if ($handle) echo "Success!";
+
if ($handle) echo "Success!";
else print_r(error_get_last());
+
else print_r(error_get_last());
?>
+
?>

Latest revision as of 10:01, 17 March 2013

Test, if a file can be written to directory

<?php
$handle = fopen("/tmp/test.txt", "x");
if ($handle) echo "Success!";
else print_r(error_get_last());
?>