function sql()
{
$connection = mysql_connect($this->host, $this->user, $this->pass) or die (“tenging”);
// vellja gagnagrunn
mysql_select_db($this->db) or die (“gat ekki valið gagnagrunn”);
$query = “select count(*) from notandi where user= ‘$this->adminuser’ and pass = ‘$this->adminpass’”;
$this->result = mysql_query($query) or die (“villa: $query. ” . mysql_error());
mysql_fetch_row($this->result);
}


function logi()
{
if ( ( $this->adminuser == $_POST[ 'user' ] ) && ( $this->adminpass == $_POST[ 'pass' ] ) ) {
echo ‘Velkomin(n), ’ .$this->adminuser;
} else {
echo ‘Rangt notendanafn eða lykilorð’;