I created a website with some code examples I wrote. I'm fine with people downloading the source code and letting them use it as they wish. But I'd like to put some language on my website saying that the code can only be posted on my website. I don't want people to take my source and post it on their own websites as their own. I'd like to at least get the credit for the code by having people visit my site.
While I know in reality people will do whatever they want, I'd at least like some kind of evidence that I tried protecting myself in case I ever need to bring this against an individual that is maliciously posting or using the code examples I've written.
Any suggestions on how to do this?