Chuyên mục
Internet

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

Rate this post



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:

Tag: post get php, post and get superglobals php, post and get superglobals in php, php post and get superglobal, post and get superglobal, get superglobal in php, post superglobal in php, post and get methods in php, post and get method in php, get and post superglobals in php, get and post methods in php, get and post method in php, post method in php, PHP tutorial, php, mmtuts, learn php programming, php for beginners, php tutorial for beginners

Xem thêm: https://meohay360.com/category/internet

Nguồn: https://meohay360.com

27 trả lời trong “26: POST and GET Superglobals in PHP | PHP Tutorial | Learn PHP Programming | PHP for Beginners”

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

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.

<?php
echo $_POST ['name'];
?>
<form method="POST">
<input type="hidden" name="name" value="Jack">
<button type="submit">Submit</button>
</form>

Trả lời

Email của bạn sẽ không được hiển thị công khai.