Hello, in this video, we are going to take a look at keeping the values in the form. Because if we go to our form, and let's reload the page, and if I click Submit we get error, obviously is empty. And let's say for this type something into the mouse what it is. And as a photo from here, I'm telling you 12345. Now, if I click Submit, this is valid, this is invalid, if you have a form like this, and you put something invalid. So maybe it is a login page, it says URL, because I'll do some URL, you know, sort of check in, but it could be wherever you want to be username email address, could be URL, maybe maybe it's a login for a particular website, for example, and only you will the owner can login.
And if you type in the wrong URL, instead of having to type that in again, it just puts it there. You won't put the password there. Here for security reasons. We just prevent you from you know, constantly having to retype this and honestly Really simple to do. So where we have down here, you know, the URL, the URL var, so what we actually want to do is we'll grab hold of this will disappear, and we'll just, you know, make it empty. That's all we're gonna do.
And now what we are going to do is, and we don't even want to, actually we don't even want to do this. We don't want to validate it, Cliff, we validate it, we will, we'll get a little problem. So could we want the original raw data that the user put in there. So I'm going to say, URL role, for example, equals this. And right here, we'll say dollar URL role equals basically this We can actually just use the war URL here for a URL role. And now if we scroll down where we have the URL right here, so in input, what we can actually do is provide a value for this.
So what we can do is say value. And then we can put some PHP here. And we'll literally just echo the roll URL. So if we reload this now, nothing's here. And but if I type in some fish, something, I click Hello, as you can see, it's, it's signed, it's an invalid URL format, but it still puts it there. And let's say if I put a valid URL format like an old hotmail.com and I'll forget common password if you're still there, but the password you know, in recall the password Whatever, hello, for example, it works.
Obviously, at the moment, this doesn't do anything, but if it did, that'd be great. But this video is covering how to keep the values in the form that's really useful. And it really helps the user experience. So you know, having the user to type out their username again and again and again, make maybe they're making a little mistake with the password. It happens to all of us. So it's really, really useful when us more things.
But when you see when you don't see it in a website, you get annoyed by that website, especially when you can't remember your own password. So that is it. Any questions? Feel free to pop me a message and as usual, I look forward to seeing you in the next video.