How to make admin panel for my files
<p>Let say i've the follow files [index.php / admin.php / access.php]</p>

<p><strong>1) File index.php is with login form</strong></p>

<pre><code>&lt;form method="post" name="login" id="login" action="check.php"&gt;
Username : &lt;input name="loginid" id="loginid" type="text"&gt;
Password : &lt;input name="password" id="password" type="password"&gt;
&lt;/form&gt;
</code></pre>

<p>it should send entries (user,pass) to file check.php so that check if the username and password is correct or not and i'd like to use this way</p>

<p><strong>2) File check.php</strong> </p>

<p>At file check.php it should do the following function
- Check if the user,pass is correct
- If correct then create cookies or somehow
- If wrong or empty send me back to login.php</p>

<p>Let say here are my db informations</p>

<pre><code>$sql= "select * from settings where admuser='$loginid' and admpass='$password'";
$result = mysql_query($sql) or die("query failed: $sql");
</code></pre>

<p><strong>3) File access.php</strong></p>

<p>This file should compare if i've logged or not so that if not send me back to login.php</p>

<p><strong>4) File admin.php</strong> [ needs access.php to check if i'm logged or not]</p>

<pre><code>&lt;?php
include('access.php');
echo "balah blah blah";
?&gt;
</code></pre>

<p>So can anyone please write this example as simple as possible</p>

<p>That example will helps me a lot to study it as study case
cause i've tried before but failed so i really do not know why and here was my last question <a href="http://stackoverflow.com/questions/9025961/login-not-working-after-php-updated">Login not working after php updated</a> but i found i need complate study case code that working.</p>

<p>thank you for helping</p>
