About the author

Yogesh Koli

Yogesh Koli is a software engineer & a Blogger lives in India. He's driven by an addiction to learning and a love for adventure. he has 5+ years of experience working with the front-end, back-end, web application development, and system design.

15
Leave a Reply

avatar
12 Comment threads
3 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
13 Comment authors
muhammadbinusmanShabir BalochFaRoPatrickDonald Recent comment authors

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
newest oldest most voted
Notify of
muhammadbinusman
Guest
muhammadbinusman

how to run this in phpmyadmin?

Shabir Baloch
Guest

I want to learn PHP so can you help me my project title is book management system.
I am basically from Balochistan i am doing may BSCS form Balochistan University(UOB Quetta)

FaRo
Guest
FaRo

Hi, thank you for your tutorial. I have an error for DB() … it says it is undefined function. what should I do?

Patrick
Guest
Patrick

I have an error on this login please help me!

this is my error: Fatal error: Uncaught Error: Call to undefined function DB() in C:\xampp\htdocs\login\lib\library.php:67 Stack trace: #0 C:\xampp\htdocs\login\index.php(54): DemoLib->isEmail(‘pobsina@gmail.c…’) #1 {main} thrown in C:\xampp\htdocs\login\lib\library.php on line 67

Donald
Guest
Donald

Why don’t you require or include database.php on the index.php file? With the current way your script is written, it’s impossible for the register / login to work.

salichuma
Guest

Hi Thank you for your tutorial, I get a problem with $db=DB(); it says undefined. I have separated user registration into another file and library in another file. Need your assistance if possible.

Ben
Guest
Ben

Hello,

I would like to know how to secure my site against XSS attacks.

Konstantinos Rizos
Guest
Konstantinos Rizos

Very nice tutorial but how i can do the same exactly with sqlite PDO????

Murdoc Lewis
Guest
Murdoc Lewis

Hi, how would I go about redirecting the user to their profile page with “php?id=” in the address bar? Also, I’m curious if there is a way to share this link with other users?

Thapelo
Guest
Thapelo

Thank you for your tutorial. It was very helpful.

omerida
Guest
omerida

Besides the use of sha256 instead of PHP’s built in password functions there are a couple of problematic samples in this article that I wouldn’t want novices to pick up as good habits. First, using constants for your database credentials is an unneeded global dependency for your DB() function. They really should be passed into DB as parameters. Consequently, DB() should be injected as a dependency to the DemoLib class, not pulled in from the global scope via $db = DB(). Second, password should be uniquely salted not just hashed. Again, there’s a reason PHP added password_hash, just use it.… Read more »

Yogesh Koli
Guest

I appreciate your feedback, above all the things is going to cover in upcoming tutorials.

omerida
Guest
omerida

Great! Although for #3 – you should never rely solely on clientside validation. You’ll still need to validate input with PHP (clients can misbehave or someone could do a POST to your form with using your HTML). For #5 – yes PDO with prepared statements guards you from SQL Injection attacks but if you’re storing what the user suppleis and then echo’ing without escaping, that’s a XSS vector.

OnceBuilder CMS
Guest

Weldone! Add it do OnceBuilder

Yogesh Koli
Guest

Thank you, we will think about it.