Jump to content

CripDawg

Member
  • Posts

    135
  • Joined

  • Last visited

Everything posted by CripDawg

  1. Thanks for the reply the same issue occurs after setting the memory multiplier to 32.0 in the bios
  2. Hi guys, I have just recently built my pc with the following specs: AMD 5950X Aorus 3090 Master Aorus X570 Pro Wifi Corsair AX850 Corsair Vengeance 3600mhz 2x32GB 64GB And despite updating to the latest drivers and bios I continue to get WHEA uncorrectable errors and event viewer shows something like reported by:processor core error type: bus interconnect error I have read many reports on this forum and others of people having similar issues it seems to be a bit more stable with the last few bios updates currently running bios F31q I just want to get a few thoughts on wether I should RMA the cpu as it could take a very long time for a replacement to arrive as there are global supply issues and I’m in Australia. this error used to happen when I’d alt tab out of games (no longer happens) it now happens from anywhere between 1-6 hours of gaming other then this error the pc Is a beast and plays like a dream hence why I’m considering holding off on a RMA request until the supply situation improves. thanks for any guidance or assistance you guys can give.
  3. Cheers for the advice I'll probably just go with whatever replaces the 3950X then, I will also be using this PC for VM's on occasion so the extra cores will be helpful... Correct me if I'm wrong?
  4. Hi Guys, I've decided I will be building a PC in the coming months, I will be waiting for the 3080 Ti. Not to sure whether to wait for the Ryzen 4000 or get a 3950X. Recently I've seen the news that the Ryzen 4000's will only be available in prebuilt systems, not to sure if this means they will be waiting to release the high end flagship models later on? Question is should I wait if the 4000 series flagships are not released around the same time as the 3080 Ti, or should i just buy a 3950X instead?. Thanks for the advice in advance. :)
  5. after my computer was turned off by being pulled out from the power point I'm getting this error 0xc000000f the boot selection because a required device is inaccessible i tried going into the BIOS and was unsuccessful Windows 7 on a 120gb 840 EVO SSD the rest of the specs can be found on my forum profile
  6. i need help doing a structure chart for my webpage witch consists of a login and shopping cart system i have attempted to make one but my teacher says that it needs to be less like a flowchart and i am also wondering whats some good software besides Microsoft word because it doesn't have the type of arrows used to represent the flow of data. Any help or advice is appreciated
  7. where about in my code would i put that also i would prefer something that goes along with the code in the tutorial so i continue it because I'm almost finished it
  8. when i click the logout button nothing happens where it should delete the session and then redirect to index.php witch should the echo 'you need to login or register' but nothing happens
  9. but I've gone so far with this and it seems to be exactly what i need so i would see it as a big waste of time if i was to start again
  10. could you maybe direct some people who might be able to help to this post please?
  11. how do i do that and do you have any idea how to fix my problem
  12. my login and register pages are working fine just a logout button that isn't working I'm watching a oop tutorial on youtube and I'm unto this part I've tried some debugging that other forms have said i should do like the error log line but still no result sorry for attaching so much code but i feel that its necessary because their are a fair amount of methods that relate to the logout and some of them are on different files User.php <?phpclass User {private $_db,$_data,$_sessionName,$_isLoggedIn; public function __construct($user = null) {$this->_db = DB::getInstance(); $this->_sessionName = Config::get('session/session_name'); error_log("session name: ".$this->_sessionName); if(!$user) {if(Session::exists($this->_sessionName)) {$user = Session::get($this->_sessionName); if($this->find($user)) {$this->_isLoggedIn = true;} else {//process logout}}} else {$this->find($user);}} public function create($fields = array()) {if (!$this->_db->insert('users', $fields)) {throw new Exception('there was a problem creating your account');}} public function find($user = null) {if($user) {$field = (is_numeric($user)) ? 'id' : 'username';$data = $this->_db->get('users', array($field, '=', $user)); if($data->count()) {$this->_data = $data->first();return true;}}return false;} public function login($username = null, $password = null){$user = $this->find($username); if($user) {if($this->data()->password === Hash::make($password, $this->data()->salt)) {Session::put($this->_sessionName, $this->data()->id);return true;}} return false;} public function logout() {Session::delete($this->_sessionName);} public function data() {return $this->_data;} public function isLoggedIn() {return $this->_isLoggedIn;}} index.php <?phprequire_once 'core/init.php'; if(Session::exists('home')) {'<p>' . Session::flash('home') . '</p>';} $user = new User();if($user->isLoggedIn()) {?><p>Hello <a href="#"><?php echo escape($user->data()->username); ?> </a></p> <ul><li><a href="logout.php">Log out</a></li></ul> <?php} else {echo '<p>You need to <a href="login.php">Log In</a> or <a href="register.php">Register</a></p>';} DB.php <?phpclass DB {private static $_instance = null;private $_pdo,$_query, $_error = false, $_results, $_count = 0; private function __construct() {try {$this->_pdo = new PDO('mysql:host=' . Config::get('mysql/host') . ';dbname=' . Config::get('mysql/db'), Config::get('mysql/username'), Config::get('mysql/password'));} catch(PDOException $e) {die($e->getMessage());}} public static function getInstance() {if(!isset(self:_instance)) {self:_instance = new DB();}return self:_instance;} public function query($sql, $params = array()) {$this->_error = false;if($this->_query = $this->_pdo->prepare($sql)) {$x = 1; if(count($params)) { foreach($params as $param) { $this->_query->bindValue($x, $param); $x++; } } if($this->_query->execute()) { $this->_results = $this->_query->fetchALL(PDO::FETCH_OBJ); $this->_count = $this->_query->rowCount(); } else { $this->_error = true; }} return $this;} public function action($action, $table, $where = array()){if(count($where)=== 3) {$operators = array('=', '>', '<', '>=', '<='); $field = $where[0];$operator = $where[1];$value = $where[2]; if(in_array($operator, $operators)) {$sql = "{$action} FROM {$table} WHERE {$field} {$operator} ?"; if(!$this->query($sql, array($value))->error()) {return $this;} }} return false; } public function get($table, $where) {return $this->action('SELECT *', $table, $where);} public function delete($table, $where) {return $this->action('DELETE', $table, $where);} public function insert($table, $fields = array()) {$keys = array_keys($fields);$values = '';$x = 1; foreach($fields as $field) {$values .= "?";if($x < count($fields)) {$values .= ', '; }$x++;} $sql = "INSERT INTO users (`" . implode('`, `', $keys) . "`) VALUES ({$values})"; if(!$this->query($sql, $fields)->error()) {return true; } return false;} public function update($table, $id, $fields) {$set = '';$x = 1; foreach($fields as $name => $value){$set .= "{$name} = ?";if($x < count($fields)){$set .= ', '; }$x++;} $sql = "UPDATE {$table} SET {$set} WHERE id = {$id}"; if(!$this->query($sql, $fields)->error()) {return true; } } public function results() {return $this->_results;} public function first() {return $this->results()[0];} public function error() {return $this->_error;} public function count() {return $this->_count;} } logout.php <?phprequire_once 'core/init.php'; $user = new User();$user->logout(); Redirect::to('index.php'); Session.php <?phpclass Session {public static function exists($name) {return (isset($_SESSION[$name])) ? true : false;} public static function put($name, $value) {return $_SESSION[$name] = $value;} public static function get($name) {return $_SESSION[$name];} public static function delete($name) {if(self::exists($_SESSION[$name])) {unset($_SESSION[$name]);}} public static function flash($name, $string = '') {if (self:: exists($name)) {$session = self::get($name);self::delete($name);return $session;} else {self::put($name, $string);}}}
  13. did a quick google......is that being able to call private variables outside of a class eg user and session variables? i know there is a constructor in user.php if i login with the correct details it redirects me from login.php therefore the Redirecting is not the problem if i delete the session cookie manually and refresh my browser it says you need to login or register as it should and my href in index.php is correct then ether my logout function on user.php or my delete function in DB.php are incorrect an i on the right track with finding the issue i trust you already found it you just want me to find it myself
  14. it creates a new user object so that i can pull stuff from the user class
  15. ok ill give it a shot it will probably be wrong though haha im just copying a video series <?phprequire_once 'core/init.php'; $user = new User(); //not to sure what this line does $user->logout(); // this runs the logout method in User.php witch uses the delete function in DB.php to delete the session of the user Redirect::to('index.php'); //redirect to index.php using the to function in Redirect witch will display you need to login or register because there is not a valid session anymore DB.php <?phpclass DB {private static $_instance = null;private $_pdo,$_query, $_error = false, $_results, $_count = 0; private function __construct() {try {$this->_pdo = new PDO('mysql:host=' . Config::get('mysql/host') . ';dbname=' . Config::get('mysql/db'), Config::get('mysql/username'), Config::get('mysql/password'));} catch(PDOException $e) {die($e->getMessage());}} public static function getInstance() {if(!isset(self:_instance)) {self:_instance = new DB();}return self:_instance;} public function query($sql, $params = array()) {$this->_error = false;if($this->_query = $this->_pdo->prepare($sql)) {$x = 1; if(count($params)) { foreach($params as $param) { $this->_query->bindValue($x, $param); $x++; } } if($this->_query->execute()) { $this->_results = $this->_query->fetchALL(PDO::FETCH_OBJ); $this->_count = $this->_query->rowCount(); } else { $this->_error = true; }} return $this;} public function action($action, $table, $where = array()){if(count($where)=== 3) {$operators = array('=', '>', '<', '>=', '<='); $field = $where[0];$operator = $where[1];$value = $where[2]; if(in_array($operator, $operators)) {$sql = "{$action} FROM {$table} WHERE {$field} {$operator} ?"; if(!$this->query($sql, array($value))->error()) {return $this;} }} return false; } public function get($table, $where) {return $this->action('SELECT *', $table, $where);} public function delete($table, $where) {return $this->action('DELETE', $table, $where);} public function insert($table, $fields = array()) {$keys = array_keys($fields);$values = '';$x = 1; foreach($fields as $field) {$values .= "?";if($x < count($fields)) {$values .= ', '; }$x++;} $sql = "INSERT INTO users (`" . implode('`, `', $keys) . "`) VALUES ({$values})"; if(!$this->query($sql, $fields)->error()) {return true; } return false;} public function update($table, $id, $fields) {$set = '';$x = 1; foreach($fields as $name => $value){$set .= "{$name} = ?";if($x < count($fields)){$set .= ', '; }$x++;} $sql = "UPDATE {$table} SET {$set} WHERE id = {$id}"; if(!$this->query($sql, $fields)->error()) {return true; } } public function results() {return $this->_results;} public function first() {return $this->results()[0];} public function error() {return $this->_error;} public function count() {return $this->_count;} } User.php <?phpclass User {private $_db,$_data,$_sessionName,$_isLoggedIn; public function __construct($user = null) {$this->_db = DB::getInstance(); $this->_sessionName = Config::get('session/session_name'); if(!$user) {if(Session::exists($this->_sessionName)) {$user = Session::get($this->_sessionName); if($this->find($user)) {$this->_isLoggedIn = true;} else {//process logout}}} else {$this->find($user);}} public function create($fields = array()) {if (!$this->_db->insert('users', $fields)) {throw new Exception('there was a problem creating your account');}} public function find($user = null) {if($user) {$field = (is_numeric($user)) ? 'id' : 'username';$data = $this->_db->get('users', array($field, '=', $user)); if($data->count()) {$this->_data = $data->first();return true;}}} public function login($username = null, $password = null){$user = $this->find($username); if($user) {if($this->data()->password === Hash::make($password, $this->data()->salt)) {Session::put($this->_sessionName, $this->data()->id);return true;}} return false;} public function logout() {Session::delete($this->_sessionName);} public function data() {return $this->_data;} public function isLoggedIn() {return $this->_isLoggedIn;}} Redirect.php <?phpclass Redirect {public static function to($location = null) {if($location) {if(is_numeric($location)) {switch($location) {case 404:header('HTTP/1.0 404 Not Found');include 'includes/errors/404.php';exit();break;}}header('Location: ' . $location);exit();}}}
  16. should have done code blocks sorry I've checked the to methods delete, to and login and made sure my href line has the correct file name Session.php <?phpclass Session {public static function exists($name) {return (isset($_SESSION[$name])) ? true : false;} public static function put($name, $value) {return $_SESSION[$name] = $value;} public static function get($name) {return $_SESSION[$name];} public static function delete($name) {if(self::exists($_SESSION[$name])) {unset($_SESSION[$name]);}} public static function flash($name, $string = '') {if (self:: exists($name)) {$session = self::get($name);self::delete($name);return $session;} else {self::put($name, $string);}}} logout.php <?phprequire_once 'core/init.php'; $user = new User();$user->logout(); Redirect::to('index.php'); index.php <?phprequire_once 'core/init.php'; if(Session::exists('home')) {'<p>' . Session::flash('home') . '</p>';} $user = new User();if($user->isLoggedIn()) {?><p>Hello <a href="#"><?php echo escape($user->data()->username); ?> </a></p> <ul><li><a href="logout.php">Log out</a></li></ul><?php} else {echo '<p>You need to <a href="login.php">Log In</a> or <a href="register.php">Register</a></p>';}
  17. my oop login and register script is working pretty well except for the Logout button on index.php im sure that the links a correct im pretty sure all the methods that are used are correct i back tracked to where my tutorial explains the methods and double checked my code as far as i can see its correct but the button doesn't work i also the flash does not work when registration is complete will attach my entire project so far for reference. thanks in advance for any help index.phplogin.phplogout.phpregister.phpinit.phpConfig.phpDB.phpHash.phpInput.phpRedirect.phpSession.phpToken.phpUser.phpValidate.php index.php login.php logout.php register.php init.php Config.php DB.php Hash.php Input.php Redirect.php Session.php Token.php User.php Validate.php
  18. this should echo an array of data that is in the data base along with 'incorrect username or password' but it only echo's Incorrect username or password user.php public function find($user = null) {if($user) {$field = (is_numeric($user)) ? 'id' : 'username';$data = $this->_db->get('users', array($field, '=', $user)); if($data->count()) {$this->_data = $data->first();return true;}}} public function login($username = null, $password = null){$user = $this->find($username); print_r($this->_data); return false;}}[/code] login.php <?phprequire_once 'core/init.php'; if(Input:: exists()) {if(Token::check(Input::get('token'))) { $validate = new Validate();$validation = $validate->check($_POST, array('username' => array('required' => true),'password' => array('required' => true))); if($validation->passed()) {$user = new User();$login = $user->login(Input::get('password')); if($login) {echo 'Success';}else {echo '<p>Incorrect Username or Password</p>';} } else {foreach($validate->errors() as $error) {echo $error, '<br>';} }}}?> <form action="" method="post"><div class="field"><label for="username">Username</label><input type="text" name="username" id="username" autocomplete="off"></div> <div class="field"><label for="password">Password</label><input type="password" name="password" id="password" autocomplete="off"></div> <input type="hidden" name="token" value="<?php echo Token::generate(); ?>"><input type="submit" value="Log in"></form>
  19. getting a really wired error from a file that i haven't changed at all during this file creation and was working fine this only started happening when i added the match for the passwords then i deleted it to see if the error was resolved and the error was still there also it appears in one of my text boxes with BR tags in between the words Notice: Undefined index: username in /Applications/XAMPP/xamppfiles/htdocs/xampp/ooplr/classes/Input.php on line 23 Notice: Undefined index: name in /Applications/XAMPP/xamppfiles/htdocs/xampp/ooplr/classes/Input.php on line 23 Validate.php <?phpclass Validate{private $_passed = false,$_errors = array(),$_db = null;public function __construct() {$this->_db = DB::getInstance();} public function check($source, $items = array()) {foreach($items as $item => $rules) {foreach($rules as $rule => $rule_value) { $value = trim($source[$item]); if($rule === 'required' && empty($value)) {$this->addError("{$item} is required");} else if(!empty($value)) {switch($rule) {case 'max':if (strlen($value) > $rule_value) {$this->addError("{$item} must be a maximum of {$rule_value} charcters");}break;case 'min':if (strlen($value) < $rule_value) {$this->addError("{$item} must be a minimum of {$rule_value} characters");}break;case 'matches':if($value != $source[$rule_value]) {$this->addError("{$rule_value} must match {$item}");}break;case 'unique': break;}}}} if (empty($this->_errors)) {$this->_passed = true;} return $this;} private function addError($error) {$this->_errors[] = $error; } public function errors() {return $this->_errors;} public function passed(){return $this->_passed;}} register.php <?phprequire_once 'core/init.php'; if(Input::exists()) {$validate = new Validate();$validation = $validate->check($_POST, array('username' => array('required' => true,'min' => 6,'max' => 20,'unique' => 'users'),'password' => array('required' => true,'min' => 6),'password_again' => array('required' => true,'matches' => 'password'),'name' => array('required' => true,'min' => 2,'max' => 50))); if($validation->passed()) {echo "passed";} else {print_r($validation->errors());}}?><form action ="" method= "post"><div class="field"><label for= "username">Username</label><input type= "text" name= "username" id ="username" value="<?php echo escape(Input::get('username')); ?>" autocomplete="off"></div> <div class="field"><label for="password">Choose a password</label><input type="password" name="password" id="password"> <div class="field"><label for="password_again">Confirm password</label><input type="password" name="password_again" id="password_again"> <div class="field"><label for= "name">Name</label><input type= "text" name= "name" value="<?php echo escape(Input::get('name')); ?>" id ="name"></div><input type="submit" value="Register"></form> Input.php <?phpclass Input {public static function exists($type = 'post'){switch ($type) {case 'post':return (!empty($_POST)) ? true : false;break;case 'get':return (!empty($_GET)) ? true : false;break; default:return false;break;} } public static function get($item) {if(isset($_POST[$item])) {return $_POST[$item];} elseif(isset($_GET)) {return $_GET[$item];}return ''; }}
  20. now ive got a new problem this should echo the requirements for each field eg. username required must be 1 however it does not echo the rule value FIXED output: username required must be {rule_value} register.php <?phprequire_once 'core/init.php'; if(Input::exists()) {$validate = new Validate();$validation = $validate->check($_POST, array('username' => array('required' => true,'min' => 15,'max' => 20,'unique' => 'users'),'password' => array('required' => true,'min' => 6),'password_again' => array('required' => true,'matches' => 'password'),'name' => array('required' => true,'min' => 2,'max' => 50))); if($validation->passed()) {//register user} else{// output errors}}?><form action ="" method= "post"><div class="field"><label for= "username">Username</label><input type= "text" name= "username" id ="username" value="" autocomplete="off"></div> <div class="field"><label for="password">Choose a password</label><input type="password" name="password" id="password"> <div class="field"><label for="password_again">Confirm password</label><input type="password" name="password_again" id="password_again"> <div class="field"><label for= "name">Name</label><input type= "text" name= "name" value="" id ="name"></div><input type="submit" value="Register"></form> Validate.php <?phpclass Validate{private $_passed,$_errors = array(),$_db = null;public function __construct() {$this->_db = DB::getInstance();} public function check($source, $items = array()) {foreach($items as $item => $rules) {foreach($rules as $rule => $rule_value) {echo "{$item} {$rule} must be {rule_value}<br>";}}} }
  21. this next bit is not really a error the form is not doing what its supposed to its meant to echo submitted when the submit button is pressed however it does it when the form is loaded input.php <?phpclass Input {public static function exists($type = 'post'){switch ($type) {case 'post';return (!empty($_POST)) ? true : false;break; case 'get';return (!empty($_GET)) ? true : false;break; default:return false;break;} }} register.php <?phprequire_once 'core/init.php'; if(input::exists()) {echo 'submitted';}?><form action ="" method= "post"><div class="field"><label for= "username">Username</label><input type= "text" name= "username" id ="username" value="" autocomplete="off"></div> <div class="field"><label for="password">Choose a password</label><input type="password" name="password" id="password"> <div class="field"><label for="password_again">Confirm password</label><input type="password" name="password_again" id="password_again"> <div class="field"><label for= "name">Name</label><input type= "text" name= "name" value="" id ="name"></div><input type="submit" value="Register"></form>
  22. great that worked ive gone a fair way in the tutorail and are getting some more errors that i dont know how to fix Warning: Missing argument 3 for DB::update(), called in /Applications/XAMPP/xamppfiles/htdocs/xampp/ooplr/index.php on line 7 and defined in/Applications/XAMPP/xamppfiles/htdocs/xampp/ooplr/classes/DB.php on line 102 Notice: Undefined variable: fields in /Applications/XAMPP/xamppfiles/htdocs/xampp/ooplr/classes/DB.php on line 106 Warning: Invalid argument supplied for foreach() in /Applications/XAMPP/xamppfiles/htdocs/xampp/ooplr/classes/DB.php on line 106 <?phpclass DB {private static $_instance = null;private $_pdo,$_query, $_error = false, $_results, $_count = 0; private function __construct() {try {$this->_pdo = new PDO('mysql:host=' . Config::get('mysql/host') . ';dbname=' . Config::get('mysql/db'), Config::get('mysql/username'), Config::get('mysql/password'));} catch(PDOException $e) {die($e->getMessage());}} public static function getInstance() {if(!isset(self:_instance)) {self:_instance = new DB();}return self:_instance;} public function query($sql, $params = array()) {$this->_error = false;if($this->_query = $this->_pdo->prepare($sql)) {$x = 1; if(count($params)) { foreach($params as $param) { $this->_query->bindValue($x, $param); $x++; } } if($this->_query->execute()) { $this->_results = $this->_query->fetchALL(PDO::FETCH_OBJ); $this->_count = $this->_query->rowCount(); } else { $this->_error = true; }} return $this;} public function action($action, $table, $where = array()){if(count($where)=== 3) {$operators = array('=', '>', '<', '>=', '<='); $field = $where[0];$operator = $where[1];$value = $where[2]; if(in_array($operator, $operators)) {$sql = "{$action} FROM {$table} WHERE {$field} {$operator} ?"; if(!$this->query($sql, array($value))->error()) {return $this;} }} return false; } public function get($table, $where) {return $this->action('SELECT *', $table, $where);} public function delete($table, $where) {return $this->action('DELETE', $table, $where);} public function insert($table, $fields = array()) {$keys = array_keys($fields);$values = '';$x = 1; foreach($fields as $field) {$values .= "?";if($x < count($fields)) {$values .= ', '; }$x++;} $sql = "INSERT INTO users (`" . implode('`, `', $keys) . "`) VALUES ({$values})"; if(!$this->query($sql, $fields)->error()) {return true; } return false;} public function update($table, $id, $fields) {$set = '';$x = 1; foreach($fields as $name => $value){$set .= "{$name} = ?";if($x < count($fields)){$set .= ', '; }$x++;}die($set); $sql = "UPDATE {$table} SET {$set} WHERE id = {$id}"; } public function results() {return $this->_results;} public function error() {return $this->_error;} public function count() {return $this->_count;} }
  23. the guy in the tutorial he call any method named 'fetchALL' i watched the video over a million times
  24. guys im getting this error now tried googling it didnt make any sense to me Fatal error: Call to undefined method DB::fetchALL() in /Applications/XAMPP/xamppfiles/htdocs/xampp/ooplr/classes/DB.php on line 39 <?phpclass DB {private static $_instance = null;private $_pdo,$_query, $_error = false, $_results, $_count = 0; private function __construct() {try {$this->_pdo = new PDO('mysql:host=' . Config::get('mysql/host') . ';dbname=' . Config::get('mysql/db'), Config::get('mysql/username'), Config::get('mysql/password'));} catch(PDOException $e) {die($e->getMessage());}} public static function getInstance() {if(!isset(self:_instance)) {self:_instance = new DB();}return self:_instance;} public function query($sql, $params = array()) {$this->_error = false;if($this->_query = $this->_pdo->prepare($sql)) {$x = 1; if(count($params)) { foreach($params as $param) { $this->_query->bindValue($x, $param); $x++; } } if($this->_query->execute()) { $this->_results = $this->fetchALL(PDO::FETCH_OBJ); $this->_count = $this->_query->rowCount(); } else { $this->_error = true; }} return $this;} public function error() {return $this->_error;} }
×