Sometimes when I make websites I have a unique link, where the user is clicking (usually from an e-mail) and they end up at

Then I can check the code and see that the user actually did go to the page and save things to my stats.
But, sometimes I've noticed that users remove the last bit of code and the go to
I guess they remove the last part of the URL, since they don't want me to know that they were there or whatever.

So, now I thought about making something to check that the code is actually there. If there is no code in the url, then they'll be redirected to a page saying that there is no page here. Or that they didn't enter the correct url or something like that.

I guess people here have a great idea on how to make this or what I should think about when making it.

If I have a table called tbl_user with fields for username, user_code