closedir.php :
<?php
//Open send directory
if(@$dir = opendir("send"))
{
echo '<br>dir opened<br>';
//List files in send directory
while (($file = readdir($dir)) !== false)
{
echo "filename: " . $file . "<br />";
}
closedir($dir);
echo '<br>dir closed<br>';
}
else
echo 'directory not opened';
?>
=========================================
outputs :
1)
directory not opened
2)
dir opened
filename: .
filename: ..
filename: sendsms.html
filename: sendsms.php
filename: send_vard.php
filename: send_vcard_sms.html
filename: smser.php
dir closed
<?php
//Open send directory
if(@$dir = opendir("send"))
{
echo '<br>dir opened<br>';
//List files in send directory
while (($file = readdir($dir)) !== false)
{
echo "filename: " . $file . "<br />";
}
closedir($dir);
echo '<br>dir closed<br>';
}
else
echo 'directory not opened';
?>
=========================================
outputs :
1)
directory not opened
2)
dir opened
filename: .
filename: ..
filename: sendsms.html
filename: sendsms.php
filename: send_vard.php
filename: send_vcard_sms.html
filename: smser.php
dir closed