Jump to content

Security code for forms


Recommended Posts

I've been reading this long topic again:-



Shetland Wolf on 2 April 2008 and ewwatson on 5 April 2008 2.53 pm used this code:-

if (preg_replace($headers, '', $string) == $string) {

return $string;

} else {

die('You think Im spammy? Spammy how? Spammy like a clown, spammy?');




but as far as I can see, $headers and $string variables aren't defined anywhere in Eric's form, so were these just names as an example which require editig to those in your form (or Eric's form) or are they some kind of global code applicable in any case?

Link to comment
Share on other sites

Oh no, your gong to expose my ignorance with php! Got that from somewhere, I never quite new what that did either, but never removed it.


The one I have now, the one Ben and others helped me with, is pretty bullet proof. I haven't had a single spam since. I can PM you with it if you'd like.

Edited by Eric
Link to comment
Share on other sites

I've been using the same code in one of my forms but I just realised that it might not be working; on the other hand it hasn't raised any PHP warnings because I haven't got any variables defined for $headers or $string either so it may be OK; I just want clarification.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...