saalek110
Well-Known Member
save_action.php
PHP:
<?php
$masir=$_POST['masir'];
$dir=$_POST['dir'];
$filename=$_POST['filename'];
$post_text=$_POST['post_text'];
echo "masir= ".$masir;
echo"<br>";
echo "dir= ".$dir;
echo"<br>";
echo"<pre>";
//echo htmlspecialchars($post_text);
echo"</pre>";
$myfile = fopen("$dir/new_file.php", "w") or die("Unable to open file!");
//fwrite($myfile, "hmad");
fwrite($myfile, $post_text );
fclose($myfile);
$jam=$dir."/".$filename;
echo "jame= ".$jam;
$jam2=$dir."/"."old_".$filename;
echo"<br>";
echo "jam2= ".$jam2;
rename("$jame","$jam2");
$jam3=$dir."/"."new_file.php";
echo"<br>";
echo "jam3= ".$jam3;
$jam4=$dir."/".$filename;
echo"<br>";
echo "jam4= ".$jam4;
rename("$jam3","$jam4");
?>