Jump to content

Regex spam prevention


jk11uk

Recommended Posts

Hi all

 

I have made a site where people can add text and then add tags. the tags go towards working out keyword density/relevance in the search engine for the site. So currently, someone could enter word, word, word, word, word in the tags field and rank number 1 for a search on 'word'. obviously not good

 

So im guessing i have to split up the user input by ',' (they are told to separate tags by commas) into an array and then remove any further matches of each array item (so 'word, word,' wouldn't be allowed byt 'word, another word' would). also i would need to stop people putting multiple repetitions of the word in each tag item (so word word word, next word, other other, etc)

 

only problem is i dont know how  >:(

 

can anyone please help?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.