26: POST and GET Superglobals in PHP | PHP Tutorial | Learn PHP Programming | PHP for Beginners

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • POST and GET Superglobals in PHP | PHP Tutorial | Learn PHP Programming | PHP for Beginners. The POST and GET superglobal in PHP are used to transfer data from one page to another. These are VERY common in PHP and are used in a lot of scripts which makes this an important lesson to watch.
    ➤ 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

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

  • @ocanodiego
    @ocanodiego 8 лет назад +67

    Best PHP tutorials I have ever seen! Please do advanced tutorials :)

  • @kingtyphoon
    @kingtyphoon Год назад +2

    This is just a good no nonsense tutorial!

  • @SpinningOnTheFly
    @SpinningOnTheFly 6 лет назад +9

    Thanks :) I will watch entire channel :D

  • @fantasy1970
    @fantasy1970 4 месяца назад

    Bro u really help me with my project, i had looking for fix bug inside my php and fixed it as soon as saw you video

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

    finally i know how to use them !!!! amazing tutorial you saved my life !!

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

    Another great lesson. I think that sending user data (on a login page) over the URL would be a security risk so would want to use POST. I guess I will find out if I am right in following lessons.

  • @kemmrthappy2804
    @kemmrthappy2804 7 лет назад +6

    i really enjoy your videos ..but can you please make a tutorial on ajax and php??

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

    honestly can't thank you enough for this tutorial, I was going mad trying to understand this, but this video helped so muchhhhh

  • @milujuparno
    @milujuparno 7 месяцев назад

    Very nice tutorial I learned a lot!

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

    wow thank you, now i can have fun!

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

    Let's not skip ads for this guy.
    He deserves it.

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

    Dani, I'm half way thought the PHP series, and I really want to thank you, I always look in youtube how to do certain stuff and find the answer, but when trying to learn something from scratch, my experience hasn't been the best, so I use a lot Udemy, because the contents are ordered, clear and well structured, but I'm really amazed and grateful of what you've accomplished here, thank you so much! already a Huge fan!

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

    Hi, I have written an annonymous function that works once a page is loaded but upon first landing on the site I get undefined function as in the address bar the ?page=home is missing. The title shows the correct title, Home Page, and the body of text that I have also shows the page name but still I get the error.
    Do you have a tutorial covering this, I cannot locate one, or are you thinking of doing 1?
    $page = $_GET["page"];

    $getPage = function() use ($page){
    if(isset($_GET["page"])){
    echo ucfirst($page) . " Page.";
    } else {
    echo "Home Page";
    //This echo is being used on first landing on site
    // by the title and the body of text naming the page
    // Home page.
    }

    };
    Call it by
    $getPage();
    Thanks

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

    Thank you very much

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

    You are the best please

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

    Your tutorials are easy to follow and i am enjoying php.. can you make a lesson on email activation?

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

    high quality video

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

    i dont know why but i am getting the same results whether i use the methods POST or GET...the URL shows me name=value......a small help would be very helpful

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

      after trying GET method, click in the url and refresh only "loclahost/filename".

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

      cause you are not refreshing the server but might be reloading the page.

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

    Great Work. This was very helpful!

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

    Hi! when i make an echo with a $_POST variable, it shows normal, but if i pass it to JS and then getelementbyid the program adds like symbols

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

    Thanks! It was very helpful.

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

    I tried running the code on my pc but my url didnt show any name or value and its kinda holding me back........nice tutorials by the way man

  • @iqbalibrahim4713
    @iqbalibrahim4713 5 лет назад +2

    so, what's the point of using get while you can just use post method, you also mentioned before in your html & css playlist that get method has a limit of 3000 char while post method does not have any limit

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

      I believe get is good for things like verification links

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

    hello just echoed out ```echo "bin2hex(360)" ``` Why does this return 333630 to the page?

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

    Dear dani
    Tnx for your video .
    I need to know how i can appear the captcha code in busy or overloaded sites when tis not shown ( just show the image box ) by get and post method.

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

    Please make a video to prevent retainig the value when back button is pressed and to prevent resubmission using that back button data that was retained. I hope you knew what I meant / thanks

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

    This is nice!

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

    Amazing video, exactly what I was looking for, thank you!

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

    Can a variable be passed to another page without the form command?

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

    My echo $_POST['name']; is not working

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

      Maybe your "name" doesn't have any value

  • @IvanIvanov-re9fd
    @IvanIvanov-re9fd 6 лет назад

    Nice video!

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

    i don't know why post work like get? i use post and it shows the information in url Why???

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

      post should not show the info in the URL. There must be an error in your HTML :)

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

      @@Dani_Krossing There is no problem in my html file. I really don't know i see some people talk about htacces redirect but i don't know how? Any idea? thank you for the responce :)

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

    why does GET and POST have an underscore?

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

      Because it is a superglobal/global variable.

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

    You are awesome! Will you ,please , do a NodeJS tutorial? :)

  • @fahrifoxtrot-whiskey9242
    @fahrifoxtrot-whiskey9242 6 лет назад +1

    Hello Daniel,
    Apparently nobody else had this problem or they just found solution for it. I have this error message as following;
    Notice: Undefined index: name in /path/nameoffile.php on line 31
    It works though, I can get the result. But cannot get rid of this error message!
    I googled it and found people searching for an answer for the same problem. I tried all of them but none worked for me. :(
    Where is the mistake? I am using XAMPP.

    Submit

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

      You will notice that the same error shows in my video at the end :) you shouldn't worry too much about it. It appears because we haven't made a "check" using PHP, that checks if "name" even exists in the first place. In later videos I we will do this slightly different so there are no errors ;)

    • @fahrifoxtrot-whiskey9242
      @fahrifoxtrot-whiskey9242 6 лет назад +2

      Wow I wasn't even expecting you to answer due to your busyness. Got respond quickly. I hope, one day I can do something meaningful for you. Thank you!

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

    Yq

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

    4:06 hahahaha