validating url
Posted on
16th Feb 2014 07:03 pm by
admin
im trying to validate url's sent to me by a form
the url's im collecting are for placing banners on my site
so the url's are the link to there site and url of where there banner is
URL's ARE BROKEN INTO PARTs PROTOCOL/SUBDOMAIN/DOMAIN NAME/DIRECTORY/FILE
SO FAR I GOT
Code: if(!preg_match("/^http://www.[a-z0-9-].[a-z]{2,3}[a-z0-9/.] $/i", $_POST[url]))
This checks the form feild url
1) make sure http://www. is present (i dont see why it should be any different for the purpose of my use)
i wll be placing a warning on my form page that the urls must contains this
2) Then my code checks it consists of only letters,numbers,dashes/hythens i read these are the only characters a domain name can be
also they must start with a letter or number so how do i make that possible?
3) the next part makes sure theres a .
4) the next part makes sure it consists of only letter of 2-3 characters long
this only alows things such as .com or .ru
How do i alow multiple for example .co.uk
5) i then want to make the rest optional but to alow
letter/numbers/for directories . for start of ext
can anyone help me tweak my code to satisfy my needs but to be as strict as possible.
also knowing what my code is going to be checking is there any genuine urls that the code would refuse
or is there anything i need to know
304
20
Other php-forum
SOAP Issue
Hi,
I am facing some understanding problem with SOAP basic.kindly recommend some SOAP expert.
Extracting URL pointer within XML tag
Hi.
I'm trying to extract text between two quotation marks in XML. For example, I want to ex
PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg
How to use php and sql to check if values match the ones in a table (for logins)
How would I code it that the script takes two variables that are passed to it (UserID and PIN), and
Adding post count
How would I make it so everytime someone clicks submit on my form, their row in the database for the
Output Full URL of Current Page
Let's say I am currently viewing a dynamic page:
http://www.mydomain.com/directory/index.php
My query is being run with no results.
I have this.
Code: function DropUser($duser_id, $user_email, $user_username) {
script and html conflict in trying to create a header.
I have an error is occurring because of an html webpage with a "php require" at the top of
How to change www in url with a specified name
Hi
I'm trying to change the url http://www.sitename.com/apparels to something like below
http:
Need help with PHP/MySQL drop down menu
I need help on how I can implement a drop down menu which queries mysql database and output the avai