Jump to content

PHP Forms - Validate URL


Recommended Posts


first things first: Thank you for your awesome work!

I came across following site: https://www.w3schools.com/php/php_form_url_email.asp

You are validating the URL by regex, that's good way to learn a bit about this expressions. But PHP offers also a filter for validating URLs.

if (!filter_var($url, FILTER_VALIDATE_URL)) {
  $urlErr = "Invalid url format";

Might be worth mentioning.

Have a nice day and stay healthy,

Edited by Ingolme
Updated topic title
Link to comment
Share on other sites

On 5/4/2020 at 7:05 PM, Ingolme said:

Surprisingly, we get people putting their usernames as a topic title quite frequently. I don't know why.


Ok, I'll try share my retardness.

  1. I went to the forum, to share my suggestion.
  2. I saw a "Start new topic" button and pressed it.
  3. I saw two textboxes (marked as required) and a recaptcha and a textarea
  4. I read email and title...
  5. And here comes the wrong assumption:
    I thought title is meant to be my nickname, since I assumed, that I first have to create an user account (typically a nickname and an email-address) and that the textarea should help me to write my topic already, before forgetting my thought.

Maybe for knuckleheads like me, it would be better to have the inputs sorted: nickname, email address, captcha, title, tags, textarea.

Or you automatically ban email addresses of people having the title and their nickname the same. 😉

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...