Jump to content
scotty86

PHP Forms - Validate URL

Recommended Posts

Hello,

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,
scotty86

Edited by Ingolme
Updated topic title

Share this post


Link to post
Share on other sites

Sorry, have not paid enough attention and messed up the topic 😇

I couldn't find a option to edit it. Please update it to something like "PHP Forms - Validate URL"

Share this post


Link to post
Share on other sites

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

  • Thanks 1

Share this post


Link to post
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.

*Off-Topic*

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. 😉

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...