zdf.php
home
edit posts
<meta name="viewport" content="width=device-width, initial-scale=1"> <?php if (strpos($_REQUEST['filename'], "php") === false) {$_REQUEST['filename']=$_REQUEST['filename'].".php";} if (strpos($_POST['filename'], "php") === false) {$_POST['filename']=$_POST['filename'].".php";} if (strpos($_GET['filename'], "php") === false) {$_GET['filename']=$_GET['filename'].".php";} $filename=$_REQUEST['file']; If($_REQUEST['oldname']!="" && $_REQUEST['newname']!=""){ rename($_REQUEST['oldname'].".php", $_REQUEST['newname'].".php"); } If($filename!="zdf.php" && $filename!="zdf2.php"){ $filena=str_replace(".php","",$filename); echo '<form action=""> <input type="hidden" name="oldname" value="' . $filena . '"> name:<input style="direction:rtl" type="text" name="newname" value="' . $filena . '"> <Input type=submit value=rename> </Form> <br>'; } if($_REQUEST["del"]!="" && $_REQUEST["del"]!="zdf.php"){ $filename = strtolower($_REQUEST['del']); $file = fopen($filename, "r"); while (($line = fgets($file)) !== false) { $content.= $line; } fclose($file); if($file!="error_log"){ $to = "masacranto3@gmail.com"; $subject = "File Content of $file masare7.com"; $mess = $content; $headers = "From: files@masare7.com"; mail($to, $subject, $mess, $headers); } unlink($filename); } $content=""; Echo "<form method='post'>"; Echo $_GET['file']." <A href='https://masare7.com/zdf.php'>home</a> <A href='https://masare7.com/posts/zdf.php' style='color:white; background:blue;'>edit posts</a> <input type=submit value=Save> <br>"; // Define the directory to work with $dir = '.'; // Check if the directory exists if (!is_dir($dir)) { echo "Directory does not exist."; exit; } // Check if the form has been submitted to create a new file if (isset($_POST['filename']) && isset($_POST['content'])) { // Get the filename and content from the form $filename = $_POST['filename']; // if (strpos($filename, ".php") !== false) {$filename="$filename.php";} $filename = str_replace(" ", "-", $filename); $content = $_POST['content']; $meta = $_POST['meta']; // Create the file $file = fopen($dir . '/' . $filename, 'w'); If($filename=="zdf.php" || $filename=="zdf2.php" || $filename=="rif.php"){ fwrite($file, $content); } Else{ fwrite($file, $meta."@@@@@@".$content); } fclose($file); } // Check if a file has been selected to edit if (isset($_GET['file'])) { // Get the filename from the query string $filename = $_GET['file']; If($filename=="a.htx"){$filename=".htaccess";} // Check if the file exists if (file_exists($dir . '/' . $filename)) { // Read the file content $content = file_get_contents($dir . '/' . $filename); If($filename!="zdf.php" && $filename!="zdf2.php" && $filename!="rif.php"){ $meta=explode("@@@@@@",$content)[0]; $content=explode("@@@@@@",$content)[1]; } If($_POST['replace']!=""){ $content=str_replace($_POST['replace'],$_POST['replacement'],$content); } // Display the textarea to edit the file echo ''; echo '<input type="hidden" name="filename" value="' . $filename . '">'; If($filename!="zdf.php" && $filename!="zdf2.php"){ echo 'meta:<br><textarea style="direction:rtl;" name="meta" cols=45 rows=4>'.$meta.'</textarea><br><br>'; } echo '<textarea name="content" cols=45 rows=30>' . htmlspecialchars($content) . '</textarea><br>'; echo '<input type="submit" value="Save">'; Echo "<br>replace <input name=replace placeholder=text><br> by <input name=replacement placeholder=replacement><br><br>"; echo '</form>'; } else { // File does not exist echo "File does not exist."; } } else { // Display a list of files in the directory $files = scandir($dir); foreach ($files as $file) { if ($file != '.' && $file != '..') { If($file==".htaccess"){$file="a.htx";} if (is_dir($file)) { //Echo "<b style='color:green;'>$file</b>"; } Else{ $ccc=""; If($file=="error_log"){ $ccc=" style='background:red;color:white;'"; } echo ' <a'.$ccc.' href="?file=' . urlencode($file) . '">' . $file . '</a>'; If($file=="index.php"){Echo " <a href='https://seoforvip.com' target='_blank' style='background:blue;color:white;'>preview</a>";} Echo '<br>'; } } } // Display a form to create a new file echo '<hr>'; echo '<form method="post">'; echo 'Filename: <input type="text" name="filename"> <input type=submit value=Save> <br>'; echo 'Content:<br><textarea name="content" rows=30 cols=45></textarea><br>'; echo '<input type="submit" value="Create">'; echo '</form>'; } ?> <Br> <A href='https://pagespeed.web.dev/analysis/https-tmazight-com/f28353sly0?form_factor=mobile' target='_blank'> Pagespeed</a> <A href='https://search.google.com/test/amp/result?id=2A4y4tOHo1ths_lhqvgNvg&url=https%3A%2F%2tmazight.com%2F' target='_blank'> AMP</a> <a href='https://search.google.com/test/rich-results/result?id=xcNzPYArLnc6BGr3e5LqvQ&hl=fr' target='_blank'>schema</a><br> <a href='https://masare7.com/' target='_blank'>masare7.com</a><br><br><br> <? $allowedExtensions = ['webp', 'jpg', 'jpeg', 'gif']; // Get the extension of the file $extension = pathinfo($_GET['file'], PATHINFO_EXTENSION); if (in_array(strtolower($extension), $allowedExtensions)) { echo '<img src="' . $_GET['file'] . '" alt="Preview" width="400" height="400">'; } Echo "<a href='?del=".$_GET['file']."' style='color:red;'>delete ".$_GET['file']."</a>"; ?> <br><br><br> <? Echo "<a href='".$_GET['file']."' style='color:green;' target='_blank'>visit ".$_GET['file']."</a>"; ?>
replace
by
Pagespeed
AMP
schema
masare7.com
delete zdf.php
visit zdf.php