Jump to content

Neil-

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Neil-'s Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. you star, thats done the trick, thanks.
  2. Hi All. i wouldnt be asking unless i was totally stummped. but my functionality produces the following error: Warning: Cannot modify header information - headers already sent by (output started at /home/staff/public_html/Cfg_Files/clsBilling.php:84) in /home/staff/public_html/Billing/index.php on line 23 clsBilling.php [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?php class Billing { var $db_link; var $db_prefix; var $db_host; var $db_user; var $db_pass; var $db_db; var $usr_Password; var $usr_Email; var $usr_AccessLevel; var $usr_AccessLevelID; var $usr_LoggedIn; var $query_rows; var $query_result; var $firstresult; function Billing(){ $this->db_host = "localhost"; $this->db_user = "staff_clients"; $this->db_pass = "xxxxxx"; $this->db_db = "staff_clients"; } //main function function Encrypt_string($string){ $enc_string = md5($string); return $enc_string; } //Encrypt Function function DBOpen(){ mysql_connect($this->db_host, $this->db_user, $this->db_pass) or die ("failed connection due to: " . mysql_error()); mysql_select_db($this->db_db); } //Database Connection Open function DBClose(){ mysql_close(); } //Database Connection Close function DBQuery($cmdText){ $this->DBOpen(); $result = mysql_query($cmdText); $numRows = mysql_num_rows($result); $firstResult = mysql_result($result, 0); $this->query_rows = $numRows; $this->firstresult = $firstResult; $this->DBClose(); } //Database Query Function function LogInUser($email, $password) { $enc_pass = $this->Encrypt_string($password); $cmdText = "SELECT AccessLevelID FROM tblClients WHERE Email = '$email' AND Password = '$enc_pass'"; $this->DBQuery($cmdText); if($this->query_rows !== '0'){ $this->AccessLevelID = $this->firstresult; $this->SetAccessLevel(); $this->usr_Password = $enc_pass; $this->usr_Email = $email; $this->usr_LoggedIn = '1'; } else { $this->usr_LoggedIn = '0'; } } //login function function SetAccessLevel(){ $accesslevelid = $this->AccessLevelID; $cmdText = "Select AccessLeveName From tblAccessLevels WHERE AccessLevelID = $accesslevelid"; $this->dbQuery($cmdText); $this->AccessLevel = $this->firstresult; } //Get AccessLevel Function } ?> [/quote] index.php [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?php session_start(); require("../Cfg_Files/clsBilling.php"); $mode = $_GET['mode']; if($mode == 'login'){ $billing = new billing; $email = $_POST['txtEmail']; $password = $_POST['txtPassword']; $billing->LogInUser($email, $password); if($billing->usr_LoggedIn == '1'){ $_SESSION['billing_obj'] = $billing; if($billing->usr_AccessLevel == "Administrator"){ header("location: admin/index.php"); } else { header("location: user/index.php"); } } else { $error = "Invalid Email Address And/Or Password!"; } } ?>[/quote] if anyone could/would shed some light on this, theyd have a new best freind lol
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.