Hello, in this video, I am going to show you how to validate a URL. So and check if we contain the query string. So our query string is, first of all, let's create a URL variable. So you can imagine this been the URL, maybe you bought it from the user, maybe you've got it from the current website. And it's going to be equal to a string sounds like HTTPS, colon four slash four slash a.google.com. So if I validated this, to check if the URL is valid, that will come true.
But in this video, because we're going to validate it as a URL that must contain a query string, it will be false. So let me you know, just demonstrate that first. So so there will be a little filter, underscore var. And that you know the URL. You've got filter, underscore Valley Do you validate me as the URL filter on the score flag on the scope query? flag on the score query required because you know, you want the query.
And if that evaluates to true, then we're going to echo out branded URL. We're restricted. Then if it's not, we'll just echo out in valid URL, or does not. Technically could be a valid URL, but not contain the query string. So let's reload this. We get invalid URL, but does not contain the query string, the query string, then anything after the question mark, so this is just a get variable they sent using the URLs good for bookmarking.
So let's say For example, they you know, they put a link to a profile. And they say in the profile on my name for we know that valid URL with a query string that fit nothing more to it. So that's how you check a URL to see if it's not only a valid URL. So, you know, this itself is a valid URL type. But you've got to also check or we also check, we have a query string so simple as that. If you have any questions, feel free to drop me a message.
And as usual, I look forward to seeing you in the next video.