Login System Tutorial with PHP and MYSQL Database

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 852

  • @clevertechie
    @clevertechie  7 лет назад +74

    To all the people who are asking about not getting account verification email. You need to modify php.ini and set your email and email host settings. Here are my settings:
    SMTP = smtp.west.cox.net
    smtp_port = 25
    sendmail_from = vladi@clevertechie.com
    You need to find out what your SMTP is and configure accordingly.

    • @shak80z58
      @shak80z58 7 лет назад +2

      Thank you for following up on comments. Could you plz help me understand why i get this error Fatal error: Call to undefined method mysqli::error() in /home/mark87/public_html/login-system/register.php on line 19
      Nothing happens when i take () at end.

    • @clevertechie
      @clevertechie  7 лет назад +1

      Yes, removing the round brackets fixes it because there is no method error() if mysqli class, there is only property error, so it's a typo in the tutorial.

    • @joshuabenedicto4358
      @joshuabenedicto4358 7 лет назад

      Where can I find the file or where can I view the message response during the verification phase?

    • @TeBateDoamneDoamne
      @TeBateDoamneDoamne 7 лет назад +1

      i've changed that and still not sending mail . i did change my SMTP to gmail SMTP and send mail with one of my emails and the port is the same .

    • @helloworld8428
      @helloworld8428 7 лет назад +2

      where is the php.ini file? Do I have to create it?

  • @BucurIonNiculae
    @BucurIonNiculae 7 лет назад +78

    finally someone who makes in system a forgotten password. Nice job man.

    • @Knightfire66
      @Knightfire66 7 лет назад +3

      yeah thats really helpfull... but whats with double password input to be sure that the user gives in the right password ?!

    • @joyceonyeri4678
      @joyceonyeri4678 6 лет назад

      Excellent tutorial. Well done Clever.

    • @antonykiokomusyoka8162
      @antonykiokomusyoka8162 4 года назад

      @@joyceonyeri4678 Hi! kindly share the source code zip I tried to download they want $5? email: antonymusyoka45@gmail.com

  • @mohammedehsan5533
    @mohammedehsan5533 6 лет назад

    After watching the video, I think, RUclips can introduce "double Like" or "Multiple Like" option. Had there been any Multiple-Like option I would have clicked that. I have watched many Login, Registration types of HTML-PHP- CSS tutorial. But Clever Techie's one is I feel, the best specially the beautifully color coded diagram is a superb work by the presenter. This diagram clears out confusions very quickly. It is one of the keys to success. Thank you Clever Techie.

  • @ganeshkondalkar7995
    @ganeshkondalkar7995 7 лет назад

    This tutorial is really awesome! :)
    "To all the people who are asking about not getting account verification email":
    It worked for me after I added the 4th param to mail() function.
    // Code Sample here
    $headers = "From:
    ";
    mail( $to, $subject, $message_body, $headers );
    Note: I have also configured the SMTP as given below.
    There is one more article which says, you need to Right click > properties: /sendmail/sendmail.exe.
    right click > properties > compatibility > Check "Run this program in compatibility mode for "Windows XP (Service Pack 3)".
    Restart system, start the xampp server and done!

  • @madyxter8258
    @madyxter8258 6 лет назад

    To all those who are redirected to index.php , when implementing this into website
    i had the same problem then i re anlalize all the code and found the solution. You just have to put session_start(); in the starting of php coding of registration.php page. And you are good to go... 😊

  • @alexandermayorga2918
    @alexandermayorga2918 4 года назад +1

    Excellent Tutorial! The chart was very helpful to understand the workflow and what's going on at each step. Im a front end dev and was looking for a login system tutorial to implement at work for an internal dashboard. This definitely helped a lot :)

  • @KeepSkippin
    @KeepSkippin 7 лет назад

    I already built a register/login system in php in another tutorial, but this one seems 100 times better yet the video is a lot shorter than the other one, good job!

  • @angelocabaysa9400
    @angelocabaysa9400 7 лет назад

    I hope this tutorial will help all beginners who wants to learn PHP.
    Thank you Clever Techie for this tutorial

  • @arihasan3423
    @arihasan3423 7 лет назад +1

    Thanks for sharing this amazing video!! People like you who really teach others how to code. You explain everything in detail, and it shows that you have a clear understanding of your work. Keep doing this great job!!

  • @cristhiancantillo4922
    @cristhiancantillo4922 4 года назад

    This is the most detail tutorial i ever saw. Nice job

  • @Vortex-qb2se
    @Vortex-qb2se 4 года назад +2

    But where the data saves? In my computer? Wheb someone log into his acc will it save his pass and stuff on my pc??

  • @eantwi6215
    @eantwi6215 6 лет назад

    Great tutorial man! I especially liked how you (perhaps unintentionally) subtly demonstrated variations of the 'if' statement, freestyled debugging with print_r() or die, etc. ONLY ONE THING RE: that sql syntax error you made at the end, you forgot to add a space between (WHERE email='$email' AND" . "hash='$hash') during concatenation, and ended up changing the sql statement to update the hash variable with the new password. Some people unfamiliar with SQL might miss that. Other than that SMALL detail, AWESOMENESS through and through.

  • @guylemay1471
    @guylemay1471 5 лет назад

    Thanks for the offer.... I will be looking elsewhere for free tutorials on these subjects, which by the way are available to all from people who have given their times to help others enjoy the Internet Experience.

    • @emanandchill
      @emanandchill 5 лет назад

      This tutorial is free. What are you talking about?

    • @guylemay1471
      @guylemay1471 5 лет назад

      @@emanandchill
      And I just gave you a FREE comment ....now we are even!
      =>=>=> Download this video's files here: www.patreon.com/posts/login-s...

    • @0xC
      @0xC 5 лет назад

      @@guylemay1471 $5 for an entire login system with a guy explaining it. What's not to love?

  • @abdullahbiler1099
    @abdullahbiler1099 7 лет назад

    you cannot imagine how useful this thing is! Thanks a lot!

  • @veetoutas
    @veetoutas 6 лет назад

    Sir, You are incredible. I have just checked Your website. Can't thank You enough for giving away the knowledge!

  • @Riaz_kitchen
    @Riaz_kitchen 3 года назад

    Downloaded the source code but when I click on the sign up page it doesn’t work

  • @curtisjordan9210
    @curtisjordan9210 7 лет назад +1

    What flowchart software did you use? Thanks.

  • @RealToughCandy
    @RealToughCandy 7 лет назад

    This video is freaking awesome! Thank you for producing and sharing this! I don't even know why RUclips allows thumbs/up down ratings for vids like this, it should be the option to click Like and that's it.

  • @ILIILLLIIILL
    @ILIILLLIIILL 7 лет назад

    I learnt this from other tutorials. it is good for study by compare lots of codes and designs. Thanks!

  • @theberend21
    @theberend21 7 лет назад

    literaly the best login video I've ever seen and used, Thank You!

  • @ronymuliana
    @ronymuliana 6 лет назад +1

    Good tutorial!
    Try logging in with wrong password on purpose, and you will get "You have typed the wrong password" message. Then log in with the correct password. The same error message will still show again. So in error.php I added a line "unset($_SESSION['message'];" right after the echo $_SESSION['message'];
    Thanks,

  • @liljohnx3475
    @liljohnx3475 6 лет назад

    My apologies if you have already answered this, but I would like to have the verification email send to me instead of the person logging-in (in this case a student). Context: I am a teacher and attempting to create a login that will only allow students from 1 particular class to register and sign-in. At some point I would love to figure out how to use the Google id sign-in, but that is a separate question. So ideally I would need:
    1. email sent to me with name and email of student applicant containing an approve or deny function;
    2. email sent to student to let them know that their request is being processed; and finally, (I hope)
    3. an email to let them know that their registration has been approved or denied, or that there was an error of somekind.
    Also, thank you for this video!! I am actually a SOCI professor trying to figure out how to make materials online accessible for students. PHP doesn't come intuitively, so videos such as these are a massive help!
    Best regards...
    oh this is where I got stuck: early in the game i know.

  • @raymondeguagie3042
    @raymondeguagie3042 5 лет назад +1

    How can i download the video files, it's not working from the link you gave?

  • @ddstutorials6048
    @ddstutorials6048 5 лет назад +1

    I wish I could like this video more than once! Thanks for taking the time to make this and your other awesome tutorials.

    • @klausi1115
      @klausi1115 4 года назад +1

      dataspecialist open 2 account lmao

  • @jsr7599
    @jsr7599 4 года назад

    Incredibly helpful and comprehensive, thank you!

  • @michestanol9862
    @michestanol9862 6 лет назад

    Thanks for having this video, now I have an idea on my next project. thanks @Clever Techie

  • @DoubleBob
    @DoubleBob 6 лет назад

    Great quality content and I love how you go the extra mile (e.g. graphs and explanations). Subscribed.

  • @rackdevelopment
    @rackdevelopment 6 лет назад +1

    For the people wondering why when clicking signup it is not working, at the bottom of index.php you need to update the jquery. Replace the link that is there for it with this: cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js

  • @mansurbhamani3905
    @mansurbhamani3905 7 лет назад

    Excellent Clever Techie. It works fine. Good job. Well done.

  • @devanshisukhija7375
    @devanshisukhija7375 7 лет назад

    Really appreciate what you do.. you made everything really easy for me .. thanks a ton.. never stop doing what you doing... thumbs up!!

  • @karlcarloshuderz
    @karlcarloshuderz 6 лет назад

    Amazing tutorial with all the helping images and the free source code, so you can implement it very fast. Thanks a lot!

    • @clevertechie
      @clevertechie  6 лет назад

      No problem, I try to make them fun and useful.

  • @surfer2011
    @surfer2011 7 лет назад

    the signup - function is not working ... i get
    "index.php:1 POST localhost/login-system/index.php 500 (Internal Server Error)"
    once i "register".
    My System is a Raspi with Raspbian and LAMP server

  • @sharksean6363
    @sharksean6363 4 года назад

    Due to special reason I cannot download the code from your website~ So I can only type the code in the video, but I found that not all the codes(or pages) were included... But... JUST RIGHT like that, I finished the missing codes and pages by my understanding, also I fixed something wrong with the codes(may be caused by the missing codes)... ...Thanks! This video helps me a lot! Your codes is nice and concise, Thank you!

  • @EclipticalD
    @EclipticalD 7 лет назад

    You really put an effort into this. I really liked and found it very helpful. Thanks!

  • @jacobcrosby101
    @jacobcrosby101 5 лет назад +4

    The location to download the code is locked out.

  • @gamgnamstile
    @gamgnamstile 5 лет назад +1

    Hi, you didn't show "profile.php", is it possible to see how did you confirm "logged" status there?

  • @Gamesational1
    @Gamesational1 3 года назад +1

    The video that got me into web development!

  • @blablablahut
    @blablablahut 7 лет назад

    One of the best tutorials I have ever seen! Thank you very much.

    • @clevertechie
      @clevertechie  7 лет назад

      No problem, thank you for watching :)

  • @user-hq9el4ee6j
    @user-hq9el4ee6j 6 лет назад

    Heyy, Can you help me. When I hit register i get the following error Undefined variable: mysqli in C:\apache24\htdocs\loginsystem2
    ew
    egister.php on line 12

  • @jk3gwapo
    @jk3gwapo 6 лет назад

    hi! everything worked fine for me but I was wondering how would I add a background image? I've tried inserting background-image: linear-gradient(rgba(0,0,0,0.6)),url(img/bglogin.jpg); in body on the css file but it didn't work.

  • @yoshis3760
    @yoshis3760 4 года назад

    Detailed information and useful for who want to coding
    Subscribe to this guy!

  • @norbert3511
    @norbert3511 6 лет назад +1

    Hi, why I am not getting any verification emails, have tried on multiple emails, but without success. Have also configured mailserver but still nothing. Any tips ???? Thanks in advance

  • @pixelgamezz7172
    @pixelgamezz7172 6 лет назад

    i got an erroy
    this is the error what did i do wrong?
    ive downloaded the files and modify the db.php and added with the terminal from the msql folder.
    Warning: Cannot modify header information - headers already sent by (output started at C:\WinNMP\WWW\login page\index.php:6) in C:\WinNMP\WWW\login page
    egister.php on line 58

  • @cherryking1244
    @cherryking1244 7 лет назад

    After clicking button signup,i m not getting any page,it is remaining in the same page and my page style is also totally different from yours,there are no styles applied......

  • @sandou1daffe258
    @sandou1daffe258 7 лет назад +1

    Hello Sir! I need your help for CSS code for your pages, we don't see your logout.php and profile.php page code, and you have not process the automatic connexion;THANK

  • @prospeedorginal5371
    @prospeedorginal5371 7 лет назад

    Hello Clever, i'm having a problem where when i put the source code in "login-system' in www folder (WAMP), it only errors. Any solutions?

  • @NoMoreShada
    @NoMoreShada 6 лет назад

    Superb Dude!
    You have done hardwork to make video simpler as possible

  • @victormbarba1
    @victormbarba1 7 лет назад +2

    I type my name, last name , e-mail and password, and I got this - Fatal error: Call to undefined function password_hash() in line 15. Line 15 is this: $password = $mysqli->escape_string(password_hash($_POST['password'], PASSWORD_BCRYPT));
    What can it be? Please would you help me.

  • @testtest-sc2bp
    @testtest-sc2bp 7 лет назад

    Can anyone help? Whenever I try to register I just get an 'Error - registration failed' message. I've set up my PHP My Admin database exactly as Clever Techie has..

  • @shadenmohammed7089
    @shadenmohammed7089 6 лет назад +5

    at 6: 26 how to make localhost in the cmd?

  • @cecaniacc9165
    @cecaniacc9165 6 лет назад

    Thank god this code be save offline so i can still study this even tho i am in school(my teacher isn't helpful at all)
    Thank you so much, i hope this work

  • @caffeholictj1708
    @caffeholictj1708 7 лет назад

    Uhm Excuse me can you tell me what are the tools and software needed there? thanks

  • @victorjoyner8387
    @victorjoyner8387 6 лет назад

    I have completed the coding, the database is created on my phpmyadmin. The resister and log in buttons don'e do anything but send it back to the index.php page. What am I doing wrong?

    • @randycarroll9833
      @randycarroll9833 6 лет назад

      Hey Victor, if you move the code:
      ABOVE the tag. It will work.
      The problem is the code that redirects to the Profile page is a PHP header which MUST be BEFORE any HTML output. I will work if you make that update.

  • @aliasname1384
    @aliasname1384 5 лет назад

    Hi I had an error with the index page not logging in, upon checking the http error logs I found this tidbit:
    [warn] PHP Warning: Cannot modify header information - headers already sent by (output started at ~/public/login/index.php:6) in ~/public/login/register.php on line 58, referer: ht tp://websiteinfo/login/index.php
    Turns out the tutorial index.php has PHP requirements that use 'header' in the requirements.
    Since header is already defined in line 6:
    PHP will error out and not process.
    Solution: move lines 13-28 (PHP Script) in index.php above Line 6 header definition.

  • @jonsitumorang8808
    @jonsitumorang8808 7 лет назад

    Hi, how did you manage to have header function run after HTML tag without turning on output buffering?

  • @yousufummar9282
    @yousufummar9282 6 лет назад

    Hi @Clever Techie......I was follow all steps but still gives errors..simply I can't connect system into database please i need your help

  • @mohsinjaved185
    @mohsinjaved185 6 лет назад

    Sir i got a problem in your last video for regestration form when ever i click on regester button 2 time it will print same data on database 2 time how do i fix it ?? any Idea SIr ??? @Clever Techie

  • @claudiobras22
    @claudiobras22 7 лет назад

    Hi Clever, I followed your tutorial, and I have to say, It´s very helpful. and thanks for including the file. One more thing, When I loaded the index.php page without internet connection, and clicked the signup button i didnt show the signup page. and then i connected the internet it was working.

  • @gusmanadjha3928
    @gusmanadjha3928 7 лет назад

    can you help me, how to change reset password by input an email without sending email link? it is just change $_GET into $_POST?

  • @TriWaZe
    @TriWaZe 7 лет назад

    I don't know why but my registration code keeps giving me registration failed. I got it to add my account to my database once but now it just fails fails fails for no reason.

  • @JohannesMarais1968
    @JohannesMarais1968 6 лет назад +1

    I found a security flaw: If you click the logout button, and directly after that type this into the address bar: "MyUrl/Profile.php", then the profile page is displayed, as if the user logged in. The variable: $_SESSION['logged_in'] is equal to 1, so it doesn't divert to the error page.
    Does anyone have any idea how to solve this?

    • @rv3211
      @rv3211 6 лет назад

      Set $_SESSION['logged_in'] to 0, or ideally, kill the session completely. Create a session destroy script on a logout.php page, then change the headers immediately after session has been destroyed. The $_SESSION['logged_in'] would then be undefined and definitely not equal to 1. Always advisable to clean up sessions after use.

  • @mckaydavis4750
    @mckaydavis4750 6 лет назад

    This is probably a dumb question, but can somebody tell me why I get an "Access Forbidden" error when I try to open the localhost connection to the login-system/index.php file? I'm using XAMPP if that helps.

  • @VarnexArts
    @VarnexArts 6 лет назад

    Lets say I were to use a host for my website and that host does not provide comand line access. So in order to create the database, I would need to login to phpmyadmin and create the database manually. How would I do that since I can not use the script that is provided withing the download that you linked.

  • @johnedwardbautista3842
    @johnedwardbautista3842 6 лет назад

    what if the files are in the other folders? how can i return the variables which contains the error messages to the index.php where there is the login page? hope you respond pls :(

  • @0m4r21o
    @0m4r21o 6 лет назад +1

    The links that get sent to your email (reset password and verification) do not work. How come?

  • @mevintan1084
    @mevintan1084 6 лет назад

    @Clever Techie initially when i mounted this files into my htdocs it works but after sometimes i can't change the tab between login and sign up i can only access the forget pw and login page and also when typing on the login page it cannot overwrite the username and password which a suppose to be overwritten any idea how can i change it back to the original setting ? as i can access it with other computer and it works perfectly fine. that computer is running on windows 10

  • @BLaCk9404
    @BLaCk9404 6 лет назад

    I am not able to login everything else works, but login doesn't.
    After I click the login button it does not redirect me to de "profile.php" page ...
    Can anyone help me ?
    EDIT: after upload the files to a domain it worked flawlessly but locally on macOS 10.12.6 with MAMP I was not able to login

  • @omerdoron
    @omerdoron 6 лет назад

    What if type another email at the password reset page and i am generating hashes between 1-1000 (randomally),
    Could I change another persons details?
    thanks

  • @howtoit3291
    @howtoit3291 6 лет назад +1

    On the signup page when I click on sign up it just clears the form, nothing else happens. Do you have any idea why is that?

  • @erichter131
    @erichter131 6 лет назад

    what line of code causes registration page to go to profile page. There seem to be an error with the code.

  • @balenzrarabdulsamad9731
    @balenzrarabdulsamad9731 6 лет назад

    Help 9:00 , i have a problem with some messages, for example once i fill registration form the message is not appear, for example once i write wrong password nothing appear to tell me your password is wrong, look minute 9:00 , Thank you!

  • @jessevanleeuwen4779
    @jessevanleeuwen4779 6 лет назад +1

    for all the phpmyadmin users:
    CREATE TABLE `users` (
    `id` int(11) NOT NULL,
    `first_name` varchar(50) CHARACTER SET utf8 NOT NULL,
    `last_name` varchar(50) CHARACTER SET utf8 NOT NULL,
    `email` varchar(100) CHARACTER SET utf8 NOT NULL,
    `password` varchar(100) CHARACTER SET utf8 NOT NULL,
    `hash` varchar(32) CHARACTER SET utf8 NOT NULL,
    `active` tinyint(1) NOT NULL DEFAULT '0'
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1

  • @alittlebyte
    @alittlebyte 6 лет назад

    Hello, which software did you use to create that Login System PHP chart?

  • @kevinperry9425
    @kevinperry9425 7 лет назад

    Hi! Thumbs Up Techie!... Everything works properly unless if it is not directed to HTTPS: when it becomes secure, the Signup button on the index no longer works. Any ideas?

  • @haisuno
    @haisuno 6 лет назад

    i already liked your video once i saw the system chart , really GREAT JOB , it makes it super comprehensible!! btw how did you do it ? using a software or a website or what ?

  • @ferasalawadi4273
    @ferasalawadi4273 7 лет назад

    hey , first of all
    thank you very much
    i have one question
    am using my own radius desk database
    i setu every thing correctly i guess
    when am login each time am getting wrong password while thery are true ,
    can you please advice

  • @jimconnors
    @jimconnors 6 лет назад +1

    great video, quick question - what do you use to generate the login system chart @2:05 in the video?

  • @dsushik
    @dsushik 7 лет назад +1

    Great tutorial! Can you tell me what program you used to create the chart?

  • @vipinsharma5410
    @vipinsharma5410 4 года назад

    In reset_password.php i can't redirect to the success or error page it remains at white page... please help to complete this

  • @burner918
    @burner918 6 лет назад

    What tool did you use for your sitemap where you have the structure of the login system with php files in yellow?

  • @tommasomorganti3360
    @tommasomorganti3360 7 лет назад

    Logging in just reloads the page (same result with both right and wrong passwords), I have to manually go to the profile.php page to see I'm actually logged in, does anybody know why?

  • @Allright303
    @Allright303 7 лет назад +1

    Great work, thank you very much!

  • @giordwn
    @giordwn 7 лет назад

    What if I use the username as primary key in database, it's something viable? Since it can not be repeated.

  • @latutioti
    @latutioti 6 лет назад

    Great tutorial, thank you. I will be definitely trying it out.

  • @maxjandreau4696
    @maxjandreau4696 6 лет назад

    might be an idiotic question, how do I go about extracting files into apache root directory?

  • @maynarddemosthene1536
    @maynarddemosthene1536 4 года назад

    some reason I can't get the php file "sql_import" to run in the IDE (NetBeans 8.2). Any of you guys know why?

  • @fjc0071
    @fjc0071 7 лет назад

    What is this code on the bottom of the index.php:
    When I comment out the signup and login functions stop working

  • @Patrick-sr7kg
    @Patrick-sr7kg 7 лет назад

    How would I set the code to add a Paypal email when someone registers, and how would i change words on my actual website when someone is actually logged in. Such as the sign up button turning into a profile button.

  • @kevgits
    @kevgits 5 лет назад +3

    Great work! You forgot to explain the profile.php page though.

  • @scottmusik
    @scottmusik 6 лет назад +1

    How do i set up a mail server to get the sign up confirm email to work? Thank you

  • @Bori96
    @Bori96 7 лет назад

    I have been trying to download the file but no luck. @ tries with the email in the registration but there is no email received.

  • @gorankavelj5917
    @gorankavelj5917 6 лет назад

    Do we need to change url at 16:40 if we are using XAMPP and if so what do we need to change it to.

  • @varcodex45
    @varcodex45 6 лет назад

    Wonderful tutorials. Its amazing. Nice explanation. Thanks.

  • @hariharanthiagarajan7181
    @hariharanthiagarajan7181 6 лет назад

    Hi Clever Techie,
    Just wondering, what is the name of the software you used to create the flow chart at the beginning of the video - Explaining the process flow.

  • @yami4663
    @yami4663 6 лет назад

    Is there a way to manually add accounts to the database? Without using the register function.

  • @SuicideSauceNoodles
    @SuicideSauceNoodles 6 лет назад

    I’m working on a website so how do I add this to the site it self that’s what I’m trying to do

  • @1960beano
    @1960beano 6 лет назад

    so i need a log in system that enables the customer to go to a profile page that i can update as an administrator would this system be suitable

  • @jaepark75
    @jaepark75 7 лет назад +1

    Clever Techie
    What flow chart are you using? Is there a link for that?

  • @_VISION.
    @_VISION. 6 лет назад

    what mindmap is that you're using at the beginning of the video?

  • @CyanideShock
    @CyanideShock 4 года назад

    You reference "CSS.html" in the error, success and Index page but don't explain what they do, which is ridiculous.