Admin Login problems

Im experiencing problems with logging in to admin panel, even im entering the correct username/password.

I have this config.php file with the following code;

$admin_password = “admin”;
$admin_username = “admin”;

And in the admin panel php file the following code;

<?php

include_once("utils.php");
@session_start();
if($_SESSION[aname] == 4){


/*if (!isset($_SERVER['PHP_AUTH_USER']))
{
  header("WWW-Authenticate: Basic realm=\\"Cool Stuff\\"");
  header('HTTP/1.0 401 Unauthorized');
  echo 'Access Denied';
  exit;
}
else
{
  if (($_SERVER['PHP_AUTH_PW']!=$admin_password) || ($_SERVER['PHP_AUTH_USER']!=$admin_username))
  {
    header('HTTP/1.0 401 Unauthorized');
    echo "<h1>Access Denied</h1>";
    exit;

Are there any errors to find here? Or is it some issues from the server side?

Well there are a few things that stand out.

Don’t suppress errors with @ sign.
You should check if an array key or variable is set before checking against a value AND keys should be in single quotes so it should be something like this.

if(isset($_SESSION['aname']) && $_SESSION['aname'] == 4){

/* is used for commenting out code or adding notes to a page. For example

/*
This is My Page
$Variable = "Disabled";
*/

Notice that any code between an opening /* and closing */ lines, like that variable has been disabled.

You’ll see that your php section has been commented out.

Without more information about utils.php it’s hard to see what other issues might be going on.