PHP OOP Login/Register System: Introduction (Part 1/23)
Why Stack Overflow recommends it
Stack Overflow users link it as the tutorial many askers followed to build their PHP OOP login system, and as a free starting point for learning OOP in PHP.
Recommended by 3 people across 4 different months, 2014 to 2017.
What it is
The first episode of a 23-part Codecourse series on building a login and registration system in PHP using object-oriented code and PDO. It is a short introduction to the project, presented by the Codecourse channel.
What people said
Recommends SuperDJ · 2014-05 · Stack Overflow · on “Use SQL to check if user exists in database”
Well if the `isLoggedIn()` function works then there is no problem in my opionion but if it doesn't then you should give that as a param to the function. I used to do my sites like this but since a few months I use OOP and these things are a lot easier in OOP. If you also want to learn more php and even OOP check this: [this video]
Recommends Frank W. · 2016-05 · Stack Overflow · on “I need to know Object oriented Design”
There are many, many tutorials about OOP. Have a look at the following links. Free: Codecourse [this video] killerPHP [LINK] php.net [LINK] Paid: Teamtreehouse [LINK] Lynda.com [LINK] Books: There is a really good book called PHP Objects, Patterns and Practice, 3rd Edition by Matt Zandstra. Best advise I can give is to not worry so much about what tutorial to start but just start. You will only learn by keep doing it (trial & error) and keep reading about it. --Edit-- What I would advise you different from @Ema.jar is to stick to one language.
Recommends develpr · 2016-09 · Stack Overflow · on “Why is my object inside of an array?”
I am doing the codecourse php oop login/register tutorial [this video] and have run into some trouble. The issue I am having is with these lines: $user = new User(); $login = $user->login(Input::get('username'), Input::get('password')); These run conditionally on validation passing, which it does, because it returns no errors. I want to make this as simple as possible and don't think I need to include too much code because I think I have narrowed down the problem. This is the code in my user class for the login function public function login($username = null, $password = null) { $user = $this->find($username); print_r($this->_data); if($user) { if ($this->data()->password === Hash::make($password
Recommends develpr · 2017-03 · Stack Overflow · on “How do I parse object data from MySQL database using PHP PDO?”
I have run into an issue while trying to return object data from my database. I followed this tutorial [this video] to build a DB wrapper and have been trying to extend the functionality of it to suit my needs. My problem is that when I use the DB class "get" method to return data, it also returns an instance of the PDO object itself. I am wondering how I parse this data so that I only return objects from the database, and not the database object itself. I want to be able to display different database values for each object eventually. Here is all of my relevant code: class DB { private static $_instance = null; //stores instance of database private $_pdo, $_query, $_error = false, $_results, $_c
Cites user3261963 · 2014-02 · Stack Overflow · on “PHP showing up as a text instead of the application”
So I am new to coding PHP and am working on creating a login system. I have followed this tutorial and have done everything that he has said, but when I open any of the files it just shows the code. [this video] I really need help figuring this out and would love any feedback that I can get. Here is the code that I used for index.php <?php require_once 'core/init.php'; if(Session:exists('home')) { echo '<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="r
Cites Sanbron Liong · 2014-06 · Stack Overflow · on “Expanding GROUP BY query into existing PDO get query in PHP”
Ok, I will take that as advice. Of course you did not see the PDO here because I did not show you, it was in the other lines, the contructor function. Do you think this guy's tutorial is useless? [this video]
Cites astronomicalXoom · 2016-11 · Stack Overflow · on “Login in a website with a CRSF Protection”
Introduction: I'm making a project that is based on this [this video] . A PDO PHP-OOP Login/Register script with some certain functions, and one of it is CRSF Protection. The CRSF Protection in this project is making a random token, and verify it everytime when user login/register. Problem: So here's the catch, how do I login/register on this website from another website? Just like the Facebook Developers - Login API [LINK] ? Clarify things up: My problem is like this: (all of the sites aren't true but it is only for demonstration) I'm in pleaselogmein.com and there's a field that you can enter your login information for thisismyproject.com , and it's gonna log you in. or this example: I'm in sta
Cites RossS · 2016-11 · Stack Overflow · on “PHP PDO MySql query results not updated”
hopefully I can explain this clearly enough. On my profile page (let's call it profile.php ), I am including a header file ( header.php ) that contains all the HTML header code and menu, as well as some queries to show stats to a user (how many surveys they have completed, and rewards earned). There are multiple queries on this page, but all work as expected, such as header.php <h3> <?php $whereCnt = array( array('svy_end_status','=',1), array('svy_end_mem_id','=',$member_id) ); $svycnt = DB::getInstance()->get( 'COUNT(*) AS Count', 'survey_end', $whereCnt ); echo $svycnt->first()->Count; ?> </h3> Back in profile.php I have another query to get all the user profile information: $wheremem = a
Cites cnapsys · 2017-01 · Stack Overflow · on “php mbstring mcrypt mysql login issue”
I feel like I'm losing my mind. Hoping someone can point me in the right direction. I built an oop login/registration system following this tutorial PHP OOP Login/Register system [this video] Everything was working perfectly until yesterday. I had to rebuild apache/php to install the mbstring extension. I'm a complete noob so please be patient with me. I was able to track down what's happening. The salt that is being stored in MySQL no longer works to verify the user's password. password field in MySQL is varchar(64) with utf-8_general_ci collation salt field is varchar(32) with utf-8_general_ci collation Here are the relevant functions that handle the login/registration: Hash.php class Hash { pu