53 comments on “Login and Registration Using OOP with MySQLi
  1. @bonaca: actually this is an easiest login & registration method. this is only for the beginners who wants to start with oop php so that’s why i just didn’t pack the email varification at this code sorry for that!!

  2. I am really inspired together with your writing abilities as neatly as with the format in your weblog. Is that this a paid topic or did you modify it yourself? Anyway keep up the excellent quality writing, it is uncommon to see a nice weblog like this one nowadays..

    • nothing stays paid in the world of web sir… & this is not a paid topic also !! what i tries to do here give the knowledge that i got coz sharing extends more knowledge & i believe that truely !! thanks for the nice comment !! 🙂

  3. how can i remove this warning:
    Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\w3progm_oop_login\include\class.user.php:70) in C:\xampp\htdocs\w3progm_oop_login\login.php on line 11
    plz say. i am new in php.

  4. Somebody essentially help to make critically articles I might state. That is the first time I frequented your website page and thus far? I amazed with the research you made to create this actual put up extraordinary. Wonderful activity!

  5. this is the part i don’t get it , can u explain it to me ?
    first we deal with query verify yes yes bla bla and :
    $user_data = mysql_fetch_array($result);
    $count_row = mysql_num_rows($result);

    if ($count_row == 1) {
    $_SESSION[‘login’] = true;
    $_SESSION[‘uid’] = $user_data[‘uid’];

    • yes ofcourse i can explain. while fetching data of the user i’m counting if there’s any other user in that name is stored in my db or not. if yes means 1 row is there in that name than it’ll store that login user name in a session variable & if not than it’ll create an error message, that’s it !!

  6. hai..your post oops concept is nice for me..if u dont mind can u please give me ur gmail id??i want talk 2 u on something else??

    • you can’t do that. without submitting form how can you insert something. is there any logic? what you can do is may be can do with jquery on hover or click effect by which you can run an ajax request than by that request you can insert something into db. otherwise it’s not possible. there must be a click or hover or some event needs to take place. try study jquery with ajax request. may be it can help you.

    • what you need to do is just insert some data using php into mysqli.
      when inserting some data for registration use this code for the query

      $query = "INSERT INTO users SET uname='Stuttgart', upass='****', fullname='Stuttgart Yeah', [email protected]',)";
      $mysqli->query($query);
      printf ("New Record has id %d.\n", $mysqli->insert_id);

      this code will help you to insert your desired data..

  7. pleas i want the code of the payment method in the technical support system for college and how can I set the terms of reference of each user if a student or admin , or what is known as URL .. thanks in advance 🙂

    • For setting the terms of reference of each user you might need to user user role in your system by that you can have the information of each user who’s logging into your system with the credibility. In that way you can provide the terms to each person of that role. And for the payment method what sort of payment method you want to use? Is it paypal or something else? For that you might want to google that or if you’re not able to do this than might want to hire someone who can do this job for you. 🙂

  8. For me it’s getting error while login on the line as (Parse error: syntax error, unexpected T_OBJECT_OPERATOR in C:\xampp\htdocs\oop_log_tuts\include\class.user.php on line 35)

    and also getting error on the line 19 as (trying to get property of non-object),i can’t rectify the error ,help me please

    • I think there’s an object error. According to your first error there seems to be syntax error. Please debug with print_r or var_dump the whole array of objects. Then you might be able to sought out the errors.
      As for the second error you’re pulling a non-object file. Please do this in the correct manner. Debug the array of objects. You’ll get the idea of what you’re pulling from the database. May be you’re pulling something like this:

      $arr = array(
      ‘a’=>’ab’,
      ‘b’=>’cd’
      );

      with this type of code $arr->a; You should get such arrays with this manner $arr[‘a’]. I think this is the solution. Debug first then you’ll get the answer.

    • “true” & “false” is the boolean part. If you get true it means the user entered the corrent information into the database & if you get false that means the user entered the wrong information.

  9. Result on local server:
    Notice: Trying to get property of non-object in C:\xampp\htdocs\Niet goed\include\class.user.php on line 28
    0Data cannot inserted

  10. First time. I am going to share view with you Mr Code provider.

    Really Your code is good for fresher developer of php.

    Nice Dear.

    R K Singh : 9818597149 New delhi (INDIA).
    Good Luck.

  11. Great blog you have here but I was curious about if you knew of any message boards that cover the same topics talked about
    in this article? I’d really like to be a part of group where I can get comments from other
    knowledgeable individuals that share the same interest.

    If you have any recommendations, please let me know.
    Thanks!

  12. Warning: myswli_fetch_array() expects parameter 1 Tobe mysqli_result,Boolean given in line no 43.
    Notice:trying to get property of non object in class.user.php on line 44.
    When I login the above errors are occured please help me on that…

Leave a Reply

Your email address will not be published. Required fields are marked *