Securing my website admin area
<p>So I'm building a GUI admin area for my site. I will be the only one to login and it will just show a clean (printable) layout of info from my db.</p>

<p>Here's what I'm doing for security. Let me know if you think this is good and how I can improve.</p>

<ol>
<li>headers on all pages check for <code>admin == true</code> or die/redirect</li>
<li>since i have a dedicated ip at home and i will only login from home. I made all pages including the login form page check for my IP <code>$_SERVER['REMOTE_ADDR'];</code> != header redirect</li>
<li>My login script is in <code>dir</code> set <code>700</code> in folder permissions.</li>
<li>my login and pw contain 10 total combo of letters, numbers and special chars. PW is stored as SHA2 HASH</li>
<li>my login script checks for <code>regex</code> prior to <code>sql</code> and my credentials are stored in a separate admin table</li>
<li>The entire site is on SSL.</li>
</ol>

<p>So is this secure? Can I do more? Is this overkill? Please share your opinions and suggestions (especially regarding my IP check. Can that be circumvented?)</p>

<p>Used to escape bad data - in conjunction with <code>regex</code> on every field</p>

<pre><code>function escape_data ($data) {
    if (function_exists(‘mysql_real_escape_string’)) {
        global $dbc;

        $data = mysql_real_escape_string (trim($data), $dbc);
        $data = strip_tags($data);
} else {
        $data = mysql_escape_string (trim($data));
        $data = strip_tags($data);
        }
        return $data;

    }
</code></pre>
