PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a script which allows people to submit a link into a database, however I was to limit the urls submitted to one site. i.e. I only wanna accept urls from http://www.example.com
PHP Manual wrote:This function is not meant to validate the given URL, it only breaks it up into the above listed parts. Partial URLs are also accepted, parse_url() tries its best to parse them correctly.
Notice: That the question mark and periods have been escaped (using backslashes). The delimiters have been changed to a commas to make it easier to work with URLs.
In my own defense I did use the word "like" in my original post. :-p
Basically what I'm doing is allowing people to submit a link from a certain site. The link is upon submission inserted into the database. if another person submits the same link, the script will merely add +1 to hits, making that link "more popular", the more times a link is added, the more hits it get in the db.
However I only wanna accept links from one site only, and therefore need to disallow everything else but that site.
oh and major thx to Buddha443556, you've been a great help to me !!
Maybe you can store domains, then store links related to the domain by id and keep track of popularity with the links table instead of the domain table.