$my_dir="./";
$scan = scandir($my_dir);
foreach ($scan as $f)
if ($f !== '.' and $f !== '..')
{
if (is_dir ($f) )
{
echo "$f<br>";
}
}
$my_dir="./";
$scan = scandir($my_dir);
foreach ($scan as $f)
if ($f !== '.' and $f !== '..')
{
if (is_file ($f) )
{
echo "$f<br>";
}
}
$pattern = '/^[a-z0-9_-]{1,40}$/'; // folders
$check = preg_match($pattern,$f);
if ($check)
{
echo $f;
echo"<br>";
}
$check = preg_match('/([a-z]+[0-9]*)\.jpe?g$/', $f, $match);
$check = preg_match('/([a-z]+[0-9]*)\.([a-z]+)$/', $f, $match);
<a href='your_file_name.php?folder=empty'>do empty</a>
if (isset($_GET['folder']) )
{
}
$my_dir="./";
if ($_GET['folder']=="empty")
{
$_SESSION['step1']="empty";
$_SESSION['step2']="empty";
$_SESSION['step3']="empty";
$_SESSION['step4']="empty";
if ($_SESSION["step1"]=="empty" || $_SESSION['step1']==NULL)
$_SESSION["step1"]=$_GET['folder'];
else if ($_SESSION["step2"]=="empty" || $_SESSION['step2']==NULL)
$_SESSION["step2"]=$_GET['folder'];
else if ($_SESSION["step3"]=="empty" || $_SESSION['step3']==NULL)
$_SESSION["step3"]=$_GET['folder'];
if (isset($_GET['folder']) )

if (isset($_SESSION['step1']))
if ($_SESSION['step1']!="empty")
$my_dir=$my_dir.$_SESSION['step1'];
if (isset($_SESSION['step2']))
if ($_SESSION['step2']!="empty")
$my_dir=$my_dir."/".$_SESSION['step2'];
$my_loci=$_SERVER['SERVER_NAME'];
$dd1='http://'.$my_loci;
$dd2=$dd1.'/esme_poshe/';
echo " ".$result2[$x]." "."<a href=$dd3><img src=$dd3 alt='c1.jpg' width='190' height=auto></a>";

$my_dir="./../../";
foreach ($scan as $f)
{
$check = preg_match('/([a-z]+[0-9]*)\.php$/', $f, $match);
if ($check) {
echo $f;
echo"<br>";
$masir=$my_dir."/".$f;
echo $masir;
$myfile = fopen("$masir", "r") or die("Unable to open file!");
$contents = fread($myfile, filesize($masir));//read file
fclose($myfile);
} // if check
} // foreach
?>
<center>
<form id='myform' action="<?php echo $_SERVER['PHP_SELF']; ?>" method = 'POST'>
<textarea id="mytextarea" form="myform" name="post_text" rows="20" cols="55">
<?php echo htmlspecialchars($contents); ?>
</textarea><br><br>
<input type="submit" name='act' form='myform' value="Submit" style=" font-size:40px; height:90px; width:150px"> </center>
<?php
|
<form id='myform' action="file_name.php" method = 'POST'>
echo "<a href='file_name.php?masir=$masir'>".$f."</a>";
$masir=$_GET['masir'];
$myfile = fopen("$masir", "r") or die("Unable to open file!");
$contents = fread($myfile, filesize($masir));//read file
fclose($myfile);
?>
<center>
<form id='myform' action="target_file.php" method = 'POST'>
<textarea id="mytextarea" form="myform" name="post_text" rows="50" cols="60">
<?php echo htmlspecialchars($contents); ?>
</textarea><br><br>
<?php
echo'<input type="hidden" id="custId" name="its_name" value='.$its_name.'>';
?>
<input type="submit" name='act' form='myform' value="Submit" style=" font-size:40px; height:90px; width:150px"> </center>
<?php
$masir=$_POST['masir'];
$post_text=$_POST['post_text'];
$myfile = fopen("newfile.php", "w") or die("Unable to open file!");
fwrite($myfile, $post_text);
fclose($myfile);











