Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
Nguồn:https://phprealestatescript.com/
Xem Thêm Bài Viết Khác:https://phprealestatescript.com/lap-trinh-php
Beginner PHP Tutorial – 47 – String Functions: Upper / Lower Case Conversion

I have created the same form in the wamp server
But when I click on submit button I'm getting time and date as the output
Please help in solving the problem
Can u tell what is the use of$_GET[ ],
And also isset ,. ! empty
Got a question: If I reload I expect everything to be reset but for some reason it keeps the value I last echo'd. What's up with that?
can any one please help me what is isset function and $_get and all please help me anyone
you didnt explain what is isset function and $_GET
most important from video is $_GET['']; i think, thank you .
Why it doesn't work?
<?php
//upper / lower case conversion
if(isset($_GET['user_name'])&&!empty($GET['user_name'])){
$user_name = $_GET['user_name'];
$user_name_lc = strtolower($user_name);
if($user_name_lc == 'alex'){
echo 'You are the best';
}
?>
<form action="index.php" method="GET">
Name: <input type="text" name="user_name" ><br><br>
<input type="submit" value="Submit!" >
</form>
This is not a beginner tutorial at all. I'm lucky I'm watching this as a refresher, but I would really be confused as a beginner.
Its best to have google handy and do research about those codes that haven't been taught. Or just go to parts 69 and 71.
For those who are confused, go and watch Parts 69 to 71 to learn about $_GET, $_POST and <form>. I do find it silly that he just jumped right into this before even teaching about it.
If you dont use method="GET", nothing changes, so i dont understand why it is used
i am not able to print or echo my name like you did in the vdo . on the top of the text box .. actually a page opens which says object not found
I'm lost on this one. Why isn't strtolower working? It echoes aLeX when you enter aLeX…I thought the point of strtolower was to change all characters to lower case. Confused.
correct me if i'm wrong
isset function is a function that checks if the string is set and not null
empty function simply checks if the string is empty
these two functions was used to for checking purposes so we won't have any error when getting a input from the user.
now there are two methods of getting inputs from the user
$GET – shows the input in the address bar
$POST – doesn't show the input in the address bar
he sets an action for the form "index.php" > this is where the web will take you when you clicked the submit button, or simply where the action will take place
he sets the method as GET > he used this so we can tell if the input is really that input we gave to the textbox
he sets the name of the textbox as "user_name" > so it will have a unique id and if we ever want to get the input from that textbox we can use ["user_name"]
isset($_GET["user_name"]) > this checks the input that we got using GET method (you can check the input in the address bar) if it is a set or not null
!empty($_GET["user_name]) > checks if the input is not empty
$_GET["user_name"] is simply equal to what we have inputted in the textbox
i guessed that he didn't explained the whole function and each statements cause it will make the video longer and he just want to show how we can use the lower case conversion
This was supposed to be a beginner php tutorial.I am really dissapointed,i wasted so much time of mine to end up at this video.
this tut is messed 🙁
its too hard but you again remind me my xhtml forms TY
Yeah, u are the best :)))
<?php
if(isset($_GET["user_name"])&&!empty($_GET["user_name"]))
{
$user_name = $_GET["user_name"];
$user_name_to_lowercase = strtolower($user_name);
if($user_name_to_lowercase=='alex')
{
echo 'Nc example on how to use string to lower for log in,'.$user_name;
}
}
?>
<form action="string length use.php" method="GET">
Name:<input type="text" name="user_name"><br><br>
<input type="Submit" value="Submit">
</form>
If you were not concerned about keeping the original structure of the user typed username.You could avoid making a second variable and the extra line of code and simply do the following:
$user_name = strtolower($_GET['user_name']);
Lots of people confused about isset also.
The isset() function is only checking that the variable inside it has been defined and "is set" that is all.
<?php
$string = 'I Could Be Any C$$$ase.';
$string_lower = strtolower($string);
$string_upper = strtoupper($string);
echo $string_lower;
echo $string_upper;
?>
omg! what are you doing alex?? you are making it like intermediate tutorial. Previously you did array examples without explaining what array is..and now this??
this tutorial suck!!!! we dont even understand isset and empty!!! and explain form action???????
i tried the exact same code but i've been getting this error:
Parse error: syntax error, unexpected end of file in C:xampphtdocstutorialsbasicFORM.php on line 22