42: How to Display Error Messages Using PHP | PHP Tutorial | Learn PHP Programming

Поделиться
HTML-код
  • Опубликовано: 4 дек 2017
  • How to Display Error Messages Using PHP | PHP Tutorial | Learn PHP Programming. In this PHP tutorial, you will learn how to show the user an error message using PHP, after they submit a form on your website. This is done by sending data back to the form using PHP validation.
    We will also cover how to keep the data in the form inputs, if the user is sent back with an error, so they don't need to re-type everything.
    ➤ GET ACCESS TO MY LESSON MATERIAL HERE!
    First of all, thank you for all the support you have given me!
    I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!
    I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.
    I hope you will find it helpful :)
    Material for this lesson: / lesson-material-42361704

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

  • @mirovaltonen6189
    @mirovaltonen6189 6 лет назад +101

    Hi Daniel! I started learning PHP out of scratch and found your videos. I actually landed a job few months ago where PHP was essential, but I didn't have that much of knowledge about it yet. I've been doing other stuff meanwhile I've been learning PHP on my own through your videos.
    Long story short: All these videos have helped me to get more and more responsibility and harder tasks from our clients.
    Thank you for helping me succeed at my job and to make a living and actually do something that is really interesting and always challenging. I don't know how to express how it feels when a random guy on RUclips actually helped me to land a job and to succeed in it. Thank you, thank you, thank you.. :)

    • @Dani_Krossing
      @Dani_Krossing  6 лет назад +14

      I am glad to see that you are getting something valuable from my lessons :)

    • @mirovaltonen6189
      @mirovaltonen6189 6 лет назад +2

      Totally! Of course it's not everything I need to learn, but getting a frequent dose of basics explained clearly and telling stuff while doing it the same time is something not a lot of people want to do. The amount of people typing what they are doing on Notepad and showing that during the video makes the learning so displeasing that the upkeep and/or developing your professional competence gets even harder than it is.

    • @gabov7862
      @gabov7862 6 лет назад +15

      you can express how you feel when a random guy on RUclips have helped you to get more businness by DONATING!!
      $Donate = $_PATREON "[Go to his website and donate]";
      if ( ) {
      { you have gotten benefits from this material
      } else {
      donate on his Patreon account
      }
      exit ( );

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

      hhhhhhh you're right

    • @navjeetbharti544
      @navjeetbharti544 4 года назад +3

      If you are earning right now, I just request you to support him on Patreon ❤. As he is not too good financially.

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

    thank you for doing this series again it's not that you did it terribly here its just you explained the html/css series way better

  • @kaustinn6817
    @kaustinn6817 6 лет назад +10

    A awesome php tutorial would be a automated email, like when you sign up for something it says, "sending verification code to email" or something, that would be really helpful!

  • @Shomi_brat
    @Shomi_brat 6 лет назад +4

    DUDE!You are gold!Thanks.

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

    Thanks for this tutorial bro, been having a hard time how to send error message back to previous page without having the log_error messages of sql showing up, thumbs up for ya

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

    Daniel is gifted to explain. Complicated staff and makes them easy. Thanks alot man you de best

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

    Enjoyed this episode also! Thank you very much!

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

    Truly speaking...Daniel you tought me PHP from scratch

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

    Thanks for everything dani....You are one of the best..... I get frustrated when learning php, sometimes I don't understand anything

  • @rockon2278
    @rockon2278 6 лет назад +2

    Hey, thanks for awesome tutorials. I've been watching the series and I'm learning fast. You should set up a donate button. you could earn some tips for sharing your knowledge. Thanks again. You Rock!

    • @Dani_Krossing
      @Dani_Krossing  6 лет назад +2

      Thank you :) I have a donate button in my channel banner and on my patreon ;)

  • @jayantbarthwal4470
    @jayantbarthwal4470 6 лет назад +4

    hey buddy , you are one of the best online teacher , thanks for these tutorials.

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

    Awesome tutorial bro!! i really liked it! thanks so much!

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

    truly helpful thank you so much!!

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

    Such a wonderful explanation!

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

    Dude this is really helpful thanks for making this❤️❤️

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

    DANI!! you are just amazing... You have literally inspired me. I wish you happiness, success and peace of mind. :)

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

    Thanks, your tutorials have been really helpful. Please drop one for shopping cart 🙏

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

    Thanks alot mmtuts :) ,I will support you

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

    Daniel, you are amazing.

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

    Thank-you for the lessons. If possible make a tutorial that allows users to create pages like on Facebook. Looking forward to hearing from you soon.

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

    Hi Daniel, I just wanted to say that your videos are so far the best I've ever seen on PHP! I've just started working with PHP and your videos helped me a lot, thanks :)) I have just one question and if you could answer I'll be grateful forever. Why the do you need to write --> value= " ' . $uid . '" ? I thought you had to use the dots only when you need to concatenate

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

    Gracias!!!!! Muchas gracias!!!!!

  • @Instructors-tube
    @Instructors-tube 2 года назад

    Really you are teaching nice.

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

    رائع كان هذا مفيدا حقا
    wow it was so useful
    your fan from egy ARABIC FAN

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

    great explanation!!

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

    Thanks for the amazing content as always. I have a question. Returning the first name, last name, and username in the URL, doesn't that pose a security risk? I've always heard that you don't use get when submitting a form.

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

    thanks so much.

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

    Thanks man

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

    Please make a course on Laravel. You are amazing

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

    Wow .. Thank You..

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

    Hey brother, are you re-uploading the previous videos or these are newly updated ones? I followed up all your previous lessons and they were awesome. Thanks for the knowledge you share with us by the way!

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

      Yes this tutorial was the final re-upload for the PHP course :)

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

    Wow amazing

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

    very helpfull video !! your tuts are aweosome,but i have one Q that i can't solve from the last 3 months, i'm working with bootstrap and when i need to display an error message for example: The user account doesn't exist its any way to display that error box over another element in the page, for example over a jumbotron (bootstrap component), so in that way i dont push the other element down in the page, thanks in advance and please keep doing this tutorials there are very helpful

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

    Instead of defining the variable inside the url and and accessing it in the signup.inc.php we could define the session variables and access the variables in the signup.inc.php. After inserting it into the database you could destroy the session right? correct me if I am wrong. The rest of the video where you prohibit deleting all the entered data and showing error only in the wrong fields is awesome! Thanks man.

  • @tomclain1952
    @tomclain1952 4 года назад +3

    Hi, Daniel! Thank you for the lession! There is a nuance though. If you leave any of the fields empty (say, password) and click submit, it still erases all fields. Not the best UX. Could you kindly advise? Thanks!

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

    when returning the values to the form isn't it easier to echo into the inputs value tag instead of echoing a whole new input line?

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

    Hi Daniel!
    Congratulations for this series, is awesome!
    Where i can find the css do u use in this video?

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

      Thank you :) I beleieve there is a link to the files on my Patreon in the video description.

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

      Ok!
      will you do a series on laravel?

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

    AWESOME!

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

    nice video
    but it's better to use sessions for storing data such as error messages or fields values

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

    Hi, I really appreciate your tutorial series, I like it!
    I can see when working with PHP and passing parameters people always work with URL. So they add parameters directly to the URL. How can I pass parameters without using the URL? Because there are some parameters that I do not want to expose because of the potential vulnerabilities.

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

      Use POST instead of GET in the attribute method of form

  • @hiteshchoudhary3412
    @hiteshchoudhary3412 6 лет назад +8

    Hey mm, please try to make laravel for beginners after this????

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

    Thanks a lot +1 sub

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

    If at first it doesn't work... try... try... try again!
    Yeah... I got it now - the whole thing!

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

    nice

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

    Hey Dude,
    Which Editor you are using??

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

    When the page is loaded you can actually get the URL parameters by simply using $_GET[param]. Then you can just do it like:
    if ($_GET['signup'] === 'empty') {
    echo 'You did not fill in all fields';
    }
    or do it like;
    $message = $_GET['signup'];
    if ($message === 'empty') {
    echo 'You did not fill in all fields';
    }
    ...and so on...

  • @aleksandarkrasic8324
    @aleksandarkrasic8324 6 лет назад +2

    I suppose we could write a switch statment with cases, and also breaks after every case instead of exit() ? :)

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

      I agree but I guess it's for the sake of the tutorial

  • @remyreijven
    @remyreijven 5 лет назад +11

    I don't get the point of using exit() within the if/elseif-statements. I assume that PHP already ignores irrelevant outcomes by itself and hence optimizing the performance.
    However, I would use a switch-statement for the $signupCheck validation, to avoid a lot of elseifs. In that case, using exit() would make more sense to me.

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

      dani is lazy, he uses if/else statements all the time...
      do yourself a favor and stop watching this tutorial, it is a waste of time believe me.

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

    it went from 0 to a hundred real quick in the series

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

    Hi Daniel, first of all big thanks for these great tutorials.
    I have a question. If the user fill in completely and correctly the form and submit it.. In the success message how can I customised it to be like this "Welcome Daniel, You are now registered"
    Daniel is the first name.
    I tried this code and it doesn't work..
    echo "'Welcome '. $first. ', You are now registered'
    It says Undefined $first.
    What is the correct way for this. Thanks

  • @AS-kw1ob
    @AS-kw1ob 4 года назад +3

    did not work for me, I'm getting an redirect loop, cause of the header location redirect to the same page, idk how to fix that

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

    Thanks.. I think there a small issue witch is when user refreshing the page the parameters will stay in url and the message will showing!!

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

    My Brother i want to ask about when i create marksheet from the user i have one issue. In subject box i can write 0 to 100 number means restriction on text boxes.

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

    Hi Daniel! You have a variable in your script called $_SERVER. What is this variable equal to?

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

    Interesting videos, just curious why you wouldn't just add the code value="" and so on to each form input, that way if the data is passed it will fill the form, if there is no data, the form will remain empty and use the placeholder text? Seems like a lot of extra lines of code that isn't needed?

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

    Hi Daniel, I have encounter a problem when using method of getting the values from the url.
    First, when I entered some illegal name eg. %^, and then correct info for other fields, I would get an error message as expected, with the corrected fields filled in using the $_GET method from the url.
    But then when I resubmit the form with corrected details, eg. dave, with all other fields filled in correctly using the GET method from the url, I got the empty error message.
    What's happening?

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

    to avoid people type html code in username or password or....., u should use htmlentities($var)

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

    Hi Dani, thanks ever so much for your courses... so easy to understand. I have a question though...
    How do I return radio button values back into the form as my radio buttons already have values assigned? eg
    q1.blah blah blah?
    Yes
    No
    N/A

  • @pianoLee-sx9dx
    @pianoLee-sx9dx 5 лет назад

    Is there any other part of the page where you can display error handlers? I get an internal error when doing this on my other pages...

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

    Thanks Daniel for the video, one question though: if the user entered invalid email and a username already in use. The signup form will throw back the error as invalid email only as it will exit with the email error in the URL before running the username handler on the signup.inc.php and it will return the username into the signup form to the user. How can we let the signup.inc.php file check the user first and last name, email and username before returning the error and how to have a combination of errors before directing the user to the signup.php?

    • @Jack-vv7zb
      @Jack-vv7zb 4 года назад

      With the way that's shown in the video we cannot. But instead what we can do is create an array, and then for each error we encounter add a string of text to that array. Then at the end of the script we can check if the array is empty (it will be empty if there are no errors) and can continue to sign the user up. We can then also display this array on the sign up page, and it will output all of errors. I'd recommend reading through the code shown on this page to get a better understanding. codewithawa.com/posts/complete-user-registration-system-using-php-and-mysql-database

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

    I'm confused on the reasoning for adding the concatenation operators in addition to the single quotes around the php variables when inserting the data pulled from the GET method into the form field.

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

    hey guys, good day! I'm stuck for almost 3 hours in the latter part of the video where the other input value will still remain if one of them got errors.
    and this is what I had found;
    this my first code:
    header('location: ../index.php?signup=email&first=$first&last=$last&uid=$uid');
    then I tried this code and this worked:
    header("location: ../index.php?signup=email&first=$first&last=$last&uid=$uid");
    Look at the quotation mark, I'd thought it is ok to use either " " or ' ' just to make you don't have any quotation mark inside your quotation mark. I hope you get what I mean.

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

    Hey Daniel I went into problem after writing this code, so straight to the point, after writing information in my input and submitting I''m geting into ' Object not found error ', it's seems that my program somehow can't read the signup=empty etc. any suggestions? in either way I can't get back into my front page, but my URL error message works fine, any suggestion bro?

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

      i am also having the same problem. ? have you solved it yet ?

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

      Noup :(

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

    Hi I followed along with the video and have all of my error messages working properly except it still enters the data into the database although the error message pops up. For example, if i leave all of the fields in the form black and click submit, the error message pops up but I get a blank entry. Or if i purposely add a username not meeting the preg_match specifications, the data is still entered into the database. How can I fix this? Thanks

  • @RakeshKumar-gh3ys
    @RakeshKumar-gh3ys 6 лет назад

    I have a form in bootstrap modals. If I hit submit button on that form and want to return back a error message "email already exist" on back to same modal page. I will try your method, it works but error message not display on modal page, and whole page stuck. can u help on them if supply the whole code.

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

    hello sir, it seems you have used so many if else condition which is very much confusing for me....in context of opening and closing of brackets.
    for my own ease of understanding may i use if.... elseif ?

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

    Hi Daniel! Very nice way to keep the input values after submission, However, is there a way to hide the values in the URL or a workaround to keep the values without using $_GET? thank you

    • @dav.R7
      @dav.R7 Год назад

      @Hayat Zee You have to use Ajax

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

      @@dav.R7 Thanks for your reply, I eventualy used the $_SESSION variables instead and kept the URL clean.

  • @pianoLee-sx9dx
    @pianoLee-sx9dx 6 лет назад

    Do you have a lesson on timestamp?

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

    I made a errorlog session variable to store error message and echoed it in a div in main page

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

    The error messages display in a different page ( or the form just wont load in )

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

    we use else if in this example as long as I know from other languages if we use else if that means the other ones are not true so if one of them is true then system will not read others, so it's not like that in php?

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

    Does the data still save into the database even though the data that the user was type is invalid? Coz i noticed in my current project that incorrect data still get save in my database? How can i avoid it?

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

    just wanna ask, if you're going to refresh the page, does the error message will disappear?

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

    If anyone has the problem that you get the value in the url but the message doesn't show up, is because you have to style the classes in your .css file, for example:
    .success {
    height: 50px;
    color: green;
    }
    .error {
    height: 50px;
    color: red;
    }

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

    I just downloaded your code (php42, video 42; How to display error....) and tested it on my localhost (Xampp). The first part, doesn't work on my Xampp. The form is working but always ends up with "index.php?signup=char" altough I used only an invalid Email. So it should say: "index.php?signup=email" !??

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

    How to find this -- *license your cms from "General Settings > License".  * it is hidden in view source and orginal file but visible in inspect and alert box also showing

  • @Omar-ef3hj
    @Omar-ef3hj 5 лет назад

    on the second method is it possible to change the "if" statement to switch case but the same process.? example is
    if(!$_GET['signup']){
    exit();
    }else{
    $sCode = $_GET['signup'];
    switch($sCode){
    case 'invalid char:
    echo"invalid character";
    break;
    case 'invalid email:
    echo"invalid email";
    break;
    default;
    echo 'asdasd";
    break;

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

    Hi Dani. at 14:17 you said that the line 38 isset will get the data from url. how does the "if(!isset([$_GET['signup'])){" will get a data from URL? or is it automatic when you coded it like that? i check the other lines and i didnt saw you declare a "signup" variable so im confuse where the "signup" variable came from.

    • @Dani_Krossing
      @Dani_Krossing  2 года назад +1

      $_GET['signup'] grabs the data from the submit button from the previous page.
      The one that looked like this in the HTML form:
      Signup
      It is the "name" attribute we grab in the URL on the next page. 🙂
      I think the reason you might be confused, is because the doesn't actually have a value. So technically, when we send it to the next page it will have no value in it, but that doesn't mean it doesn't get send anyways. It will just be "blank".
      But you have to remember, that we don't use it on the next page "because it has data in it"... But because we "just need it to exist" on the next page, to check if the form was submitted properly.
      So by inserting it into the !isset(), we check if the submitted button does not exist, in which case we send them away from our script since it shouldn't get run.
      It only exists so that we can check if the user got to our script legitimately. 🙂

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

      @@Dani_Krossing Thanks! really clarified my confusion on that part!
      bit off topic: i wonder if you will or already have a video how to upload this file to a website online(ex: Github Page)? like uploading the HTML, PHP, CSS Javascript etc to website and make it online.
      so far from what i watched what we are doing is Local only, i wonder if it is possible to upload and make the entire file work as an actual website, then all inputs will be sent to your local/database? (like the front end/website is online but all inputs will be sent to your device/pc/laptop locally...instead of Cloud/online server)
      i could be asking a big question that seems wrong, haven't experience a working online website yet...

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

    You need to make sure that you include quotes followed by period in the header method for each variable
    header('Location: ../index.php?signup=email&first='.$first.'&last='.$last.'&uid='.$uid.'');

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

      Nope :) Today it is optional whether or not to concatenate or directly insert variables into strings. I think they changed this sometime around PHP v5. But I will say that I usually prefer concatenating as well :)

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

      mmtuts /

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

    You are a STAR mmtuts

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

    Finally, Thank you! mmtus!1

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

    Do you have something like this but if you entered correctly, and sign up, the data will be save in another php file

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

    Same issue in the second part. what's going wrong ??
    [I just downloaded your code (php42, video 42; How to display error....) and tested it on my localhost (Xampp). The first part, doesn't work on my Xampp. The form is working but always ends up with "index.php?signup=char" altough I used only an invalid Email. So it should say: "index.php?signup=email" !??]

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

    Well I don't know how, but the time you tested your code at 4:34 it didn't work for me, it just gets redirected to /includes/signup.inc.php..
    Any ideas what could've happen?

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

    hey mmtuts ,why this code doesn't running on me $first = $_GET['first']; it enters on the if statement but when i'm passing the value on variable it doesn't i try to echo it but no output Hope you can help me :)

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

    Why not use the Switch case in the second method?

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

    why you dont use else if for checking errors

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

    question, how do i make the signup button that if its successful it'll take me to the next page instead of staying there and saying its successful? i need help on that can anyone tell me what to do?

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

    I think PHP should have a function or an dedicated file for login system, because it is very tedious job to write such a long code for small functionality.
    Error should be displayed using Java script at the time of entring the data (if some wrong data is inputed)

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

      javascript can be bypassed since its front-end

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

      @@ramonteuling672 thats true but some of the validation should be applied with javascript or php would slow down the server

  • @nadiajody-annehuang3360
    @nadiajody-annehuang3360 3 года назад

    how do we do this for empty radio button values?

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

    One problem is that the value doesnt save if using a textarea tag, maybe this is because value attribute works different with this tag? Anyone know how to fix...

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

    hello sir nice video , but i have one question :- after signup and entered invalid email i dont want (Fname ,Lname,username) show in URL. so for this what i have to do?

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

      use POST method instead of GET

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

    Since you're accessing your DB just if "submit" button was clicked, would it be better to die() and close() the connection when error was thrown?

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

      die() does the exact same as exit(), except using exit() we can include an error message :) However when it comes to connecting to a database using mysqli we technically don't need to close the connection again because it is done automatically. Therefore the connection should only be manually closed to improve performance in regards to PHP and MySQL.

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

      @@Dani_Krossing thanks for that quick reply!

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

    Is it possible to move the error message? Like put each error under the field where it belongs to

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

    Hi Daniel,
    Everything in my form is running correctly, but I the paragraph which was showing error and success in the first method is not showing the 2nd method, but all the other things are running absolutely fine. Please help me to identify this problem.

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

    I want to learn php from you will you teach me

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

    Hej MMuts! Jeg vil rigtigt gerne lære PHP og har lidt svært ved at følge tutorials men ved ikke hvad jeg skal gøre... vil rigtigt gerne lære det...

  •  4 года назад

    how to use it when we have any form?

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

    Hi Daniel, i know am probably commenting on these very late and i hope i get a reply to fix my problem... Whenever i click on the submit button while the forms are empty and even with the rest of the error codes, the error message doesn't show but instead show Object not found like these
    Object not found!
    The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
    If you think this is a server error, please contact the webmaster.
    Error 404
    localhost
    Apache/2.4.35 (Win32) OpenSSL/1.1.0i PHP/7.2.11
    My paths files are correct but i can't seems to figure out what the problem is exactly... Thanks, pls help me out cause i started web dev recently

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

      i might be late replying but inside signup.inc.php file you may have left an space between Location and :
      for eg" Location : url?....." whereas it should be "Location: url?... "

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

    I am getting warning msg on index page while accessing $_GET['login'] Notice: Undefined variable