I’m struggling a bit figuring out the best way accept and store a url from a web page.
Here’s my approach:
-
It should be urlencoded since it’s sent over the net to the server.
-
Specify the page as utf-8 in the header.
-
Use my_real_escape_string for inserting to the db.
-
Use strip_slashes on the input.
Does this make sense?
actually, you just need to validate, escape and trim a urls.