Getting User Input | PHP | Tutorial 10

preview_player
Показать описание

This video is one in a series of videos where we'll be looking at programming in PHP. The course is designed for new programmers, and will introduce common programming topics using the PHP language.

Throughout the course we'll be looking at various topics including variables, arrays, getting user input, loops, conditionals, object orientation and much more.

Рекомендации по теме
Комментарии
Автор

PSA: If you're getting the "Warning: Undefined array key" error, it's because the $_GET variable isn't defined yet when the page first loads. As long as everything else is done correctly, you can ignore it, the form will run fine, and the warning will disappear after the first time you click "submit".

As for why the warning doesn't show up for Mike, I'm assuming he somehow turned off error reporting; under normal circumstances, that warning should definitely appear for the code he's written.

To those eager to get rid of the warning, you could wrap the PHP code in an "if" statement that checks whether or not $_GET has been set before attempting to print the variable, but Mike hasn't gotten to if statements yet at this point in the series, so maybe that solution would be uncomfortable for some.

KTBWorld
Автор

Clearest easiest and simplest way I have ever seen someone describe code..Thank You

sidney-richards
Автор

Started learning to code during covid, first tutorial I watched was you teachig python. Couple months later & I'm building websites. Love Brotha FR

DanberryGlobal
Автор

The GOAT! Keeping civilization going. 🙌

gabehcuodsuoitneterp
Автор

Oh thanks sir ! I didn't even know that you have any other YouTube channel also.😭

abhay
Автор

You're great at explaining this stuff, Thank!

prestonhaffey
Автор

Thank you so much. I clearly understood.

futuristictech
Автор

i like understand your code more then other sir

gtechupdates
Автор

I got error undefined index i searched
the problem was solved


<?php if(isset($_GET["name"])) {
echo $_GET["name"];
}
?>

InnoTechWorld
Автор

Is an input like this from PHP saved server side? Will the "name" be displayed in the website server side?

alejandroarango
Автор

Hi, I'm Wondering if someone can help me. I have a simple task for my college course: how could I make an if statement that checks to see if the name is some value(a particular name) before sending user to a separate php page? Thank you

domo-yihj
Автор

How to get the value from form with method post ?

idirashahidaramli
Автор

why you haven't used semicolons in php section.

ShubhamSingh-monc
Автор

Pls let me know how to input data and store in array

kalpanamac
Автор

Why do I get this warning: Undefined array key "name" in C:\.... line ...

omaramdi
Автор

so i understand the $_GET functions, but lets say i want that input information to carry over to a separate file, so example a series of prompts each one in separate file, then on the last page, i wanna each out a summary of all the inputs, kinda like an order summary

blayx
Автор

Please help me to rectify this issue. I can't find out my mistake but it is showing "Undefined index:"

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="Story.php" method="get">
Name: <input type="text" name="name"> <br/>
<input type="submit">
</form>

<?php echo $_GET["name"]; ?>

</body>
</html>


Notice: Undefined index: name in C:\xampp\htdocs\www\Story.php on line 13

rayhanulislam
Автор

thq for the vedio.. its a great tutorial and easy to get into our brains.. but can we use php instead of javascript for websites.. can we..?

mukeshvoleti
Автор

nope:
echo $_GET["Password"] ?>
just gives me that, not the password.

henryward
Автор

Please be advised that no one writes forms like this in 2021. I have not written a <form> that posted to PHP in over 6+ years, personally.

Please learn JavaScript AJAX forms and use PHP to catch and process the data.

phpu