Jump to content

[SOLVED] question!


Lamez

Recommended Posts

It's pretty annoying to determine a url without http://www., you would end up getting things that aren't urls like asdf.asdf, unless you're very specific about the domain extensions (.com, .net, etc) and you would inevitably leave out some other less common ones like .tc. Not to mention you could run into the problematic ones such as .co.uk. Why not require www. or http:// to match?

 

Google "url regular expression" there are thousands out there.

Link to comment
https://forums.phpfreaks.com/topic/128306-solved-question/#findComment-664650
Share on other sites

well now I am a bit lost, I used those keywords you suggested, and I found something like this:

 

^((ht|f)tp(s?)\:\/\/|~/|/)?([\w]+:\w+@)?([a-zA-Z]{1}([\w\-]+\.)+([\w]{2,5}))(:[\d]{1,5})?((/?\w+/)+|/?)(\w+\.[\w]{3,4})?((\?\w+=\w+)?(&\w+=\w+)*)?

 

How do I use this to determined if a string is a url?

Link to comment
https://forums.phpfreaks.com/topic/128306-solved-question/#findComment-664653
Share on other sites

Well Zanus, that is a good idea!

 

I have this script I have been working on for days, and almost a week now, and I am pretty sure if you did a search on this website with the keywords ELC, or External Link Checker, you would find numerous results with topics by me. That being said, I am encrypting the get url values, after they have been pinged, and they turn out valid, then I am  adding them to the database, then checking to see if it blacklisted or not, well in order to check to see if the string is already encrypted I need to see if it is a url! Well if I go ahead and add http:// to the string I would get something like this http://f051adfaf5d5d0d1, so if a users puts in, lets say, phpfreaks.com, I need to determined that this is a valid link, but how?

Link to comment
https://forums.phpfreaks.com/topic/128306-solved-question/#findComment-664664
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.