Registration, Password Encryption, Sessions - Part 4 | PHP MVC Framework from Scratch

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

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

  • @dungaland
    @dungaland 4 года назад +7

    Greetings from Kenya. Your are the best RUclips Trainer in the Known universe

  • @khanprinters7104
    @khanprinters7104 Год назад +1

    Greetings from Bangladesh. Your are the best RUclips Trainer in the Known universe

  • @julianvogel5523
    @julianvogel5523 4 года назад +7

    Woop, Woop, part 4 and I'm really expressed by your knowlege. That's just great, you should do an Udemy course or something like that;)

    • @TheCodeholic
      @TheCodeholic  4 года назад +2

      Thanks a lot buddy. I am thinking about Udemy course, Just I don't have time for that now

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

    Zura I'm really impressed by your knowledge, thank you for this great series. Understanding what is happening under the hood of these frameworks is so helpful.

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

      Thanks buddy

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

      @@TheCodeholic After a job interview I noticed my lack of php knowledge. Shortly after I found you roadmap and after working on it for a while I had to do another project for a job interview and I passed. They offered me a job and I'm already working as a dev. Thanks Zura!

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

      Wow...
      That's amazing.. Congrats to you buddy.
      You deserved it. Happy to hear that my roadmap helped people to get a job

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

    Hello! Your lessons are awesome! Thank You very much! Very actual and helpful information. Waiting for more lessons 😊

  • @behzodjon
    @behzodjon 4 года назад +2

    Great tutorial videos! I'm enjoying!!!!!

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

    thanks dude, probably the best curse i have ever seen.

  • @benjaminlaunicke1256
    @benjaminlaunicke1256 2 года назад

    "How ever ..." 😁 Thanks for sharing your knowledge dude!

  • @basilistigris640
    @basilistigris640 Год назад

    very modern php framework thank you Zura The Codeholic

  • @LEXUANPHAT
    @LEXUANPHAT Год назад

    Hello, I have two questions to ask you:
    - (Issue 1) At minute 21:10, why did you use self::class instead of $this::class?
    - (Issue 2) At minute 23:00, the tableName() method is not static, but why were you able to call it?

    • @NargisGasimli-qb1qv
      @NargisGasimli-qb1qv 11 месяцев назад

      $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.

    • @TheCodeholic
      @TheCodeholic  11 месяцев назад +1

      In php 7.4 that was allowed, but it will not work in your version probably, so either yiu should make the tableName method static or use it with $this keyword.

  • @svenlueck1323
    @svenlueck1323 5 месяцев назад +1

    Greetings and thank you for this great series. I ran in some trouble with "Array and string offset access syntax with curly braces is no longer supported". As a workaround I added an array $values inside the Model class an stored the $data from loadData function in it. In the DBModel I changed the bindValue to: $statement->bindValue(":$attribute",$this->values[$attribute]); not really sure if this is a good solution or if it is safe. Feedback would be really nice. ANd maybe some tutorial about security, especially file uploads.

  • @Jayjwebdzine
    @Jayjwebdzine Год назад

    Hello Zura, great job! I'm really enjoying the video. However, whenever I try doing a var_dump($statement, $params, $attributes); as in 11:08 the $statement variable is showing up as NULL. Any ideas on why this is happening?

    • @NargisGasimli-qb1qv
      @NargisGasimli-qb1qv 11 месяцев назад

      @user-ou3vl6ez9l Maybe you didn't provide
      public function getAttributes(): array
      {
      return ['firstname', 'lastname', 'email', 'password', 'status'];
      }
      in the User.php file

    • @Jayjwebdzine
      @Jayjwebdzine 11 месяцев назад +1

      Thank you. I eventually found the error. There was a typo in one of the functions. Did not note which one but it was a missing arrow in this case.@@NargisGasimli-qb1qv

  • @jordanbicanic9343
    @jordanbicanic9343 2 года назад

    First of all great job, thank you for sharing your knowledge. I have a question. In 27:44 you are talking about redirecting to home page after user is successfully registered. Why not use render method with params?

  • @anmarm.9487
    @anmarm.9487 2 года назад

    finally decent tutorials. I learn alot. would you do a tutorial about creating a model with single base model with out active directory. your technique is too advance. Thank you

  • @1972PANI
    @1972PANI Год назад

    Hello, how are you, greetings. A few days ago I started this tutorial and I'm new to programming with PHP, I got this error: 'Fatal error: Uncaught Error: Call to a member function bindValue() on null in C:\xampp\htdocs\Proyectos-Canal-The -Codeholic-RUclips\php-mcv-framework\core\DbModel.php:30' with the save() method of the DbModel.php file when trying to insert a record with the variable $statement->bindValue(":$attribute" , $this->{$attribute});. Any solution? Thank you.

  • @ilya_123__
    @ilya_123__ 10 месяцев назад

    thank you! it is great tutorial!

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

    Zura tnx a lot for your work. Keep going. Best wishes.
    p.s. where you learned english or how?

  • @АнтонВогусов
    @АнтонВогусов 2 года назад

    Howdy! A question: after password_hash I have as many dots in input-password field as in hash string, but you still has the of inputted password in your input field. why?? thanx =)

    • @TheCodeholic
      @TheCodeholic  2 года назад

      You probably assigned the hashed password back into the variable which outputs in the input field.

    • @АнтонВогусов
      @АнтонВогусов 2 года назад

      ​@@TheCodeholic Thank you! Yes I did ) But I did it the same way you did. I see it in User class in save() method where $this->password = password_hash(...), so it goes to view from here, I guess. Should we use another property for password hash to save or what did I miss? =)

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

    Thanks. You are the best

  • @babaipaul515
    @babaipaul515 4 года назад +5

    hey man how are you? really love your videos ... can you make videos on laravel .. it would be really helpfull...

    • @TheCodeholic
      @TheCodeholic  4 года назад +6

      Thanks a lot. I definitely plan to make Laravel projects, but can not tell exactly when. But I will do...

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

    Nice tutorial

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

    Awosem dude

  • @AmitDas-yb3re
    @AmitDas-yb3re 4 года назад

    At 23.04 How can we call a non-static method like a static method?

    • @NargisGasimli-qb1qv
      @NargisGasimli-qb1qv 11 месяцев назад

      @AmitDas-yb3re It's Class not a object. For example User::tableName()
      You can call the class method directly

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

    Sorry for the noob question Zura. But can you explain this line:
    $this->labels()[$attribute] ?? $attribute;
    I'm not sure about what's happening with the syntaxe here, after the call to labels() function, how are you adding the [$attribute] right after.
    Also, Thank you for this series 🙏

    • @ШейхМансур-и8ц
      @ШейхМансур-и8ц 2 года назад +1

      it may be too late))) , but i will try to explain it. So he calls the function "labels" and it returns an array, after that he uses the key "$attribute" to take the value from this array.It is same as doing:
      $labels=$this->labels();
      return $labels[$attribute].

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

    Session is not working

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

    Is it not safe to just use the execute when passing the values like
    pdo->execute(
    'firstname' => $firstname
    );
    and I hope that you`ll have a PHP Laravel tutorial

    • @Akosiyawin
      @Akosiyawin 4 года назад +2

      No, it's not safe, Do no ever do that if you are inserting to database, or even if selecting, always bind it, to avoid sql injections. Imagine: you have a query like= pdo->execute(select * from users where id = $ID), in which the ID is 2 for example, so the injection can happen if a user inserted a value of like: 2 OR > 0. These will show all the users in table. This is a bad explanation, just search it.

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

      @@Akosiyawin thanks man that`s quite helpful

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

      @@geneartista9714 Darwin is wrong here, values of an array in the execute method are also sanitized for SQL. There are some minor differences (e.g. when you use an array, all values are passed as PDO::PARAM_STR). But for simple queries, it's a matter of preference really.

  • @Gandobilis
    @Gandobilis 2 года назад

    💫

  • @hustlehustles9379
    @hustlehustles9379 2 года назад

    Guys who faced the infinite action, look carefully, when Unset happens, it refers to the array and not to a specific cell of the array. I hope I can help someone, (half an hour of debugging)

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

    Hi Zura! Great videos! I have a Warning that I can't find what is the issue even watched that video 3 times. I am sure I miss something small that I hope you can help me.
    edit:
    "error messages disappeared so I deleted them, I just cant see the message 'Thanks for registering' and
    at this code below, I am noticing that $key is grey out and says: "Unused local variable" at phpstorm. Thank you in advance!
    [code]
    public function __construct()
    {
    session_start();
    $flashMessages = $_SESSION[self::FLASH_KEY] ?? [];
    foreach ($flashMessages as $key => &$flashMessage) {
    $flashMessage['remove'] = true;
    }
    $_SESSION[self::FLASH_KEY] = $flashMessages;
    }
    [/code]

    • @RasonYudha
      @RasonYudha 10 месяцев назад

      Wow, same part as mine. Did you fix it?