Aera223

0.php

Feb 23rd, 2023 (edited)
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.92 KB | Source Code | 0 0
  1. <?php
  2. //You will ned to type ?in=x into the page to setup cookie. This stops unauthorised users from seeing the login page
  3.  
  4. if($_SERVER['SERVER_PORT']==80){echo "<!DOCTYPE html><meta http-equiv='refresh' content='0.01 https://fern.rf.gd".$_SERVER['REQUEST_URI']."'/><center style='background:#dfd;font-size:32px'>Encrypting</center>";exit;}
  5. if(crc32($_REQUEST['in'])=="x"){
  6. setcookie("in", 't',2098766000,'/');}
  7. //Unauthorised users get error page.
  8. if($_COOKIE['in']==""){
  9. exit('<span style="color:#090">Hey</span> <span style="color:#900">there</span> <mark>:D</mark>');}
  10. ?>
  11.  
  12. <!DOCTYPE html><meta name="viewport" content="width=device-width, initial-scale=1"><html lang="en"><style>
  13. /*@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300&display=swap');*/ *{font-family:sans-serif;padding-top:0.1em;padding-bottom:0.1em;}input[type=submit],a{font-size:120%;}input{border-radius:10px;border:none;margin-top:0.5em}button{border:none}</style>
  14. <?php
  15. $data = file("wd.txt");$timer = 30;date_default_timezone_set('Australia/Adelaide');
  16.  
  17. if($data[2]==""){$data[2]="#993300";}if($data[3]==""){$data[3]="#ffff99";}
  18. if($data[0]=="" || $data[2]==""|| $data[3]==""|| $data[4]=="" || ($_GET['set']!="" && crc32($_REQUEST['odff'])==$data[4])){
  19.  
  20. if($_REQUEST['ws']==""){echo '<style>fieldset{margin:2.5em;color:#080;border:2px solid #d60;padding:2em}input{padding:0.3em;margin-top:0.3em;border:2px solid #960 !important;}</style><fieldset><h1>Welcome :)</h1><p><br><pre>
  21. <form action="'.$_SERVER['SCRIPT_NAME'].'" method="post">
  22. Title:  <input name="cn" placeholder="@Nick\'s writer" value="'.$data[1].'"><br>
  23. Code:   <input name="ws" value="'.$_REQUEST['odff'].'" size="7" required><br>
  24. Confirm:<input name="sc" value="'.$_REQUEST['odff'].'" size="7" required><br><br>
  25. Colour:
  26. </pre><hr>
  27. Text:<input name="fg" value="'.str_replace("\n","",$data[2]).'" onchange="document.body.style=\'color:\'+ this.value +\';\'" size="7"><br>
  28. Page:<input name="bg" value="'.str_replace("\n","",$data[3]).'" onchange="document.body.style=\'background:\'+ this.value +\';\'" size="7">
  29. <br><br>
  30. Font:<input name="fn" value="Corbel light">
  31. <input type="submit" value="Save"><br><br>
  32. Then hit enter.</p></form><h3>This editor is developed by Aera23<mark>:)</mark><br>This software keeps backup files. You can easily restore the most recent version.</h3></fieldset></html>';exit;}
  33.  
  34. elseif($_REQUEST['ws']!="" && $_REQUEST['sc'] == $_REQUEST['ws']){
  35. $set = fopen("wd.txt", "w+");
  36. $txt = time()."
  37. ".$_REQUEST['cn']."
  38. ".$_REQUEST['fg']."
  39. ".$_REQUEST['bg']."
  40. ".crc32($_REQUEST['ws'])."
  41. ".$_REQUEST['fn'];
  42. fwrite($set,$txt); fclose($set);}}
  43.  
  44. //Retrieves config
  45. $nick = $data[1];$fg = $data[2]; $bg = $data[3];$odff = $data[4];
  46.  
  47. //Send login
  48. if(crc32($_REQUEST['odff'])!=$odff){
  49. echo "<meta http-equiv='refresh' content='".$timer."'/><style>html{background:$bg;}body{color:$fg;margin-left:4em;}a{color:$fg}input{background:#bf9}span{font-size:150%}</style><title>".$nick."</title><body><h1><mark><a href='index.php'>&lt;🔑</a></mark> Editor</h2>";
  50.  
  51. echo '<form action="" method="post">
  52. <input type="text" name="odff" autofocus style="padding:0.4em;font-size:1.1em;background:#ffd;color:#00f;" placeholder="Key">
  53. <br><input type="text" name="f" value="'.$_REQUEST['f'].'" style="padding:0.3em"><input type="submit" value=":D"></form>
  54. <br><span><a href="replace.php">Replace text</a></span>
  55. <h1 style="background:#'.mt_rand(100,999).';color:#ff8">'.date("H:i:s").' | '.$_GET['f'].'</h1>';
  56. if($_REQUEST['odff']!=""){echo '<b>Incorrect password.</b>';
  57.  
  58.  
  59. //Failed password logging
  60. $s = time() .','. $_REQUEST['odff'].','.$_SERVER['REMOTE_ADDR'].'
  61. ';file_put_contents('failed.txt',$s,FILE_APPEND);}
  62. include("global.php");
  63. echo ':D';}
  64.  
  65. else{//Checks filesize
  66. if($_REQUEST['f']!=""){$fs = filesize($_REQUEST['f']);}else{$fs= 'File size';}
  67.  
  68. //Writes code after renaming file. The user should check if the file is written.
  69. if($_REQUEST['f']!="" && $_REQUEST['data']!="")
  70. {$file= $_REQUEST['f'];$data = $_REQUEST['data'];
  71.  
  72. if(strpos($_REQUEST['f'],'/') === false)
  73. {$v= time().$_REQUEST['f'].".old";
  74. copy($_REQUEST['f'],$v);}
  75.  
  76. if($data == 'clear'){unlink($_REQUEST['f']);}
  77. else{$w= fopen($file, "w");fwrite($w, $data); fclose($w);
  78. $fs=strlen($_POST['data']);}}
  79.  
  80. //Style changer
  81. if($_REQUEST['f']!=""){$x = 'style="background:#ff0;color:#000;float:right;';}else{$x = 'style="margin-left:3em;';}
  82.  
  83. //File recovery
  84. $array = array_reverse(glob("*.old"));$q = substr($array[1],10);$new = str_replace(".old", "", $q);
  85.  
  86. if($_REQUEST['new']!=""){rename($_REQUEST['new'],$_REQUEST['f']);}
  87.  
  88. //Style for main page
  89. echo'<style>html{background:'.$bg.';}body{color:'.$fg.'; font-family:'.$fn.';content-visibility:auto;}mark, input{background:#6d6}a{background:'.$fg.'; color:'.$bg.'}mark, code{color:inherit}
  90. pre{white-space:pre-wrap; word-wrap: break-word;}pre, textarea, p{max-width:1080px;font-family:monospace;
  91. form{margin-left:30px;display:inline}h1{margin-left:1.5em}@media (max-width:30em){.l{display:block}}
  92. </style><title>'.$nick.'</title><h1 style="margin-left:2em">';
  93.  
  94.  
  95. //The main page
  96. if($_REQUEST['f']==""){echo $nick;}else{echo '<b>Editing:</b> '.$_REQUEST['f'];}
  97.  
  98. echo'<form action="" method="post" id="x" style="float:right;margin-right:4em">
  99. <input type="submit" name="exit" value="❎ Sign Out" accesskey="x" style="transform:scale(0.01)"></form></h1><input type="text" class="int" name="f" size="15" placeholder="File name" value="'.$_REQUEST["f"].'" '.$x.'padding:0.8em" form="w" autofocus><input type="hidden" name="odff" value="'.$_REQUEST['odff'].'" form="w">';
  100.  
  101. if($_REQUEST['f']!=""){echo'<span style="float:right">Fork:</span>';$r = file_get_contents($_REQUEST["f"]);}
  102.  
  103. echo'<form action="'.$_SERVER['SCRIPT_NAME'].'" method="post" id="x" style="display:inline">
  104. <input type="hidden" name="odff" value="'.$_REQUEST['odff'].'"><input type="submit" value=" ✔ Edit another " accesskey="z" style="margin-left:1em;display:inline"></form>
  105. <form action="'.$_SERVER['SCRIPT_NAME'].'?set=1" method="post" id="y" style="display:inline"><input type="hidden" name="odff" value="'.$_REQUEST['odff'].'"><input type="submit" value="⚙ Change Settings" accesskey="z" style="margin-left:1em;display:inline"></form>
  106. <form action="'.$_SERVER['SCRIPT_NAME'].'" method="post" style="display:inline"><input type="hidden" name="new" value="'.$array[0].'"><input type="hidden" name="f" value="'.$_REQUEST['f'].'"><input type="hidden" name="odff" value="'.$_REQUEST['odff'].'">
  107. <input type="submit" value="📑 Restore" accesskey="r" style="margin-left:1em;display:inline"></form>
  108. <button style="margin:1em;padding:0.5em;border-radius:10px;background:#6c6;display:inline" onclick="document.getElementById(\'text\').innerHTML = \'The manual.\nThe PHP code editor is designed to help you edit PHP code. File upload is separate (files.php)\nAutomatic file recovery can only recover files if the backup file is intact. Backup files will not be deleted automatically, as they use little space.\n Note: There will be hundreds of .old files created.\';this.style.display = \'none\';document.getElementById(\'bb\').style.display = \'inline\'">Introduction</button>
  109. <button id="bb" style="display:none" onclick="document.getElementById(\'text\').innerHTML = \'Designed by Aera23, over the course of several months. It took less than 20-30 hours of coding, however, there were hundreds of different edits made to the editor.\'">Credits</button>
  110. <a href="https://phpcodechecker.com/" target="blank" style="margin:0.5em">Check your code</a>
  111. <form id="w" action="'.$_SERVER['SCRIPT_NAME'].'" method="post" accept-charset="UTF-8"><br><span style="margin-left:2em">';
  112.  
  113.  
  114. if($_REQUEST['f']==""){
  115. echo 'File upload (if available)</span><br><iframe src="files.php" style="width:97%;margin-left:2em;height:18em;border:none;"></iframe>';}
  116. else{$info = 'Editor';
  117. echo'<textarea form="w" class="text" class="int" name="data" rows="14" style="width:85%;padding:0.4em;background:#040;color:#0f0;border-radius:8px" placeholder="'.$info.'">'.htmlspecialchars($r).'</textarea><br>';}
  118. echo'<input type="hidden" name="odff" value="'.$_REQUEST['odff'].'">
  119. <div style="position:sticky;top:20px;display:inline;"><br><input type="submit" class="int" value=" 🕉 Save (Alt+S)" style="margin-left:2em;" accesskey="s"></div><br><br><a href="'.$_REQUEST['f'].'" target="blank" accesskey="2" style="margin-left:3em;">'.$_REQUEST['f'].'</a> ('.$fs.')<br>';
  120.  
  121. //Source code retrieval
  122. if($_REQUEST['f']!=""){
  123. echo '<iframe src="source.php?f='.$_REQUEST["f"].'" style="width:97%;border:none;
  124. height:20em"></iframe>';
  125. }
  126. else{/*echo'<br><span style="margin-left:2em"><b>Source code / text editor</b></span><br><span style="margin-left:2em"> Double-click text area to restore code (from localStorage)</span><br><span style="margin-left:2em"> Alt + Z = Edit another file</span><br><span style="margin-left:2em"> Alt + X = Sign out.</span><br><span style="margin-left:2em"> Alt + 2 = View the edited file.<br><br>';*/
  127. echo file_get_contents('http://yq.rf.gd/visits.html');}}
  128. ?></body></html>
Advertisement
Add Comment
Please, Sign In to add comment