Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It shouldn't be a large job to code this from scratch. All you need is admin.php with some kind of authentication and one form. I timed myself and made this in 7 minutes:</p> <h3>Login and logout</h3> <pre><code>if(isset($_GET['login'])) { // Check user credentials from db or hardcoded variables if($_POST['username'] == 'user123' &amp;&amp; $_POST['password'] == 'pass123') { $_SESSION['logged'] = true; } else { $loginerror = 'Invalid credentials'; } } if(isset($_GET['logout'])) { $_SESSION = array(); session_destroy(); } </code></pre> <h3>Login form</h3> <pre><code>if(!isset($_SESSION['logged']) || $_SESSION['logged'] !== true): ?&gt; &lt;form method="post" action="admin.php?login"&gt; &lt;?php if(isset($loginerror)) echo '&lt;p&gt;'.$loginerror.'&lt;/p&gt;'; ?&gt; &lt;input type="username" name="username" value="&lt;?php isset($_POST['username']) echo $_POST['username']; ?&gt;" /&gt; &lt;input type="password" name="password" /&gt; &lt;input type="submit" value="Login" /&gt; &lt;/form&gt; &lt;?php endif; </code></pre> <h3>Actual admin area</h3> <pre><code>if(isset($_SESSION['logged']) &amp;&amp; $_SESSION['logged'] === true): // Save contents if(isset($_GET['save'])) { file_put_contents('contents.txt', $_POST['contents']); } // Get contents from db or file $contents = file_get_contents('contents.txt'); ?&gt; &lt;a href="admin.php?logout"&gt;Logout&lt;/a&gt; &lt;form method="post" action="admin.php?save"&gt; &lt;textarea name="contents"&gt;&lt;?php echo $contents; ?&gt;&lt;/textarea&gt; &lt;input type="submit" value="Save" /&gt; &lt;/form&gt; &lt;?php endif; </code></pre> <p>Just combine those segments to get the full code. This code snippet has authentication, logout functionality and saves the contents of a textarea in a file. Alternatively you could change this so that users and content resides in database.</p> <p>Personally, it would have taken longer for me to find an appropriate lightweight CMS and configure it to work.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload