I used to get so much spam in my mailbox everyday that I was spending more time deleting it then I was adding new content, maintaining sites, or starting new sites combined (typical story right). 내 우편함에 매일 그 후, 새로운 콘텐츠를 추가했다 유지하는 사이트, 또는 새로운 사이트 (전형적인 이야기를 오른쪽)가 결합된 시작 삭제는 너무 많은 스팸 메일을 좀 더 많은 시간을 보내는 데 사용합니다.Some of your website spam is not preventable, or, it is preventable, but at the cost of usability and/or good information getting caught in the “bad stuff” as well. 스팸 메일 중 일부는 귀하의 웹사이트, 또는, 그것을 예방, 예방이 아니라 유용성 및 / 또는 좋은 정보를 "나쁜 일들에"로 잘 잡았지고의 비용.
No doubt, if you’re serious about web development you’re going to be creating and interacting with forms on a regular basis. 의심의 여지가 있으면 웹 개발에 대해 작성 돼야하고 정기적으로 심각한 형태와 상호 작용하는거야.Especially with this new web 2.0 attitude every has…gee wiz, what’s that? 특히이 새로운 웹마다 뭐 .. 이런 비상한 솜씨이 2.0 태도와 함께?
CAPTCHACAPTCHA CAPTCHA is the number one method most people are using to prevent spam today. CAPTCHA 하나의 방법은 대부분의 사람들이 오늘은 스팸 메일을 막기 위해 사용하는 숫자입니다.What is it? 그게 뭐죠?
“A CAPTCHA is a challenge response test used on computers to check if the user is human. "captcha를 확인하는 데 사용되는 컴퓨터에 도전 반응을 테스트하는 경우에는 사용자가 인간입니다.A common kind of CAPTCHA that is used on websites requires that the visitor type the letters and numbers of a distorted image. 그 방문자 유형 편지와 왜곡된 이미지의 숫자를 CAPTCHA의 웹사이트에 사용되는 일반적인 친절이 필요합니다.This method is based on the fact that is difficult for computers to extract the text from the image while it is very easy for humans.” - captchacreator.com 반면 아주 쉽게 컴퓨터는 인간에 대한 이미지에서 텍스트를 추출하는이 방법은 그 어렵다는 사실을 기반으로합니다. "- captchacreator.com
Here’sa few resources to scripts so you’ll be able to implement that functionality into your own forms: 스크립트를 여기에 몇 가지 리소스 그래서 당신이 자신의 형태로 그 기능을 구현하실 수있습니다 :
Escape Data - Prevent SQL Injections탈출 데이터 -는 SQL 주사 방지 Capcha is usless if you’re leaving your form unprotected from attack. 만약 당신이 형태의 공격으로부터 무방비 떠난다 Capcha 쓸모없는 사내입니다.Remember to filter post strings with addslashes() or mysql_real_escape_string() . addslashes와 필터를 게시 문자열 기억 () 또는mysql_real_escape_string ().
Also take a look at these functions for other similar kind of checks that might be useful: 또한 비슷한 종류의 다른 검사가 유용할 수있습니다이 함수를 한번보세요 :
htmlspecialchars() - Escapes the following characters: &,’,”,>,< ...that is the ampersand, single quote, double quote, less than, and greater than symbols.htmlspecialchars ()로 - 다음 문자 올림픽 공원 : &,',",>,< ... 그 앰퍼샌드, 작은 따옴표, 큰 따옴표,보다 적게, 그리고 기호보다 큽니다.
strip_tags() - Strips out all HTML and PHP code from the given string.strip_tags ()은 주어진 문자열에서 - 시험지 모든 HTML과 PHP 코드입니다.
htmlentities() - Converts ALL characters to their HTML entities equivalent (this is a more catch all version of htmlspecialchars).htmlentities () - 변환 모든 문자들은 HTML 엔터티 상응 (이에게 더 많은 반드시 htmlspecialchars의 모든 버전을 잡기)입니다.
urlencode() - Encodes the URL to pass strings on a GET method.를 urlencode () - 문자열 GET 메서드에 전달할 URL을 인코딩합니다.As I mentioned, don’t use GET with forms. 내가 언급했듯이, 형태로 GET을 사용하지 않습니다.This is useful when you’re passing user input variables for other reasons. 이 때는 다른 이유로 사용자 입력 변수를 넘겨있어 유용합니다.
Remember, once you convert data like this using one of the above functions, you can undo it for readability and output by using its reverse function. urlencode() for example has urldecode() to undo its actions so you can begin using the string as you would have before the encode. 기억, 일단 당신이 위와 같은 기능 중 하나를 사용하여 데이터를 변환, 난이도 및 출력에 대한 예 ()에 대한 urldecode있다는 리버스 기능을 수행합니다.를 urlencode 사용하여 () 그래서 당신은 문자열로 사용하기 시작할 수있다는 행동을 취소할 수 그것을 취소할 수있습니다 당신은 인코딩 전에 것이다.
Check Request Method확인을 요청하는 방법 Throw an if statement around your existing form processor that checks to see if data is coming from the globals post variable. 기존의 양식 않으면 프로세서 주위에 성명을 게시하고 있는지 확인하여 데이터를 전역 변수에서 볼 수 던져오고있다.If not, then the user is not accessing your form the way you designed it to be used. 다음, 사용자가 귀하의 양식을 사용하도록 설계하는 방법에 액세스하지 않는 경우.
Change this to GET if you’re using that instead. 그 대신에 사용하는 경우이 변경하십시오.However, I would high recommend you never use that method as it is more insecure. 그러나, 나는 그것을 더 높은 방법을 사용하지 불안 당신이 그것을 권합니다.
Check Request Source확인 요청이 소스 You should also check to see if the request is originating from your own server. 또한 요청하는 경우에는 사용자 자신의 서버에서 발생한되어 있는지 확인한다.This is a very common method of form abuse which doesn’t necessarily mean you’ll be receiving spam. 이 양식은 반드시 남용하지 않는 스팸 메일을 받게 될 수있다는 뜻은 매우 일반적인 방법입니다.If you’re server is getting a lot of bounced emails to its default email you may have someone abusing your site in this manner. 경우 서버가 되었군요 많아지고있다는 기본 이메일에 당신이 누군가를이 방식으로 귀하의 사이트에 이메일을 튕겨 악용 할 수있습니다.
<?php
$source=$_SERVER[‘HTTP_HOST’];
//or if you want to detect just the domain you can use a regular expression to filter it.
//The referrer should also be from your own domain…Likewise, if there is no referral then the user obviously isnt using your form correctly (so we dont have to check for that).
//Note: stristr() searches for the first occurrence of a string inside another string.
Using Regular Expressions For Data Validation정규식을 사용하여 데이터 유효성 검사를위한 I like to check data using preg_match (or any of the regular expression functions). preg_match를 사용하여 데이터를 확인하려면 (또는 정규 표현식 함수의).This method kills a lot of birds with one stone. 이 방법은 하나의 돌을 많이 조류의 사망.Why write separate functions to check if a string is empty, then another if it allows numbers, and another if it allows alpha characters, and another to specific field length, and another…you get the point. 이유를 확인하고 별도의 기능을 쓸 문자열이 비어있다면, 그 후 또 다른면, 다른 경우 알파 문자와 숫자 수 있도록, 그리고 또 다른 특정 필드의 길이에, 또 ... 네가 요점을 파악했다.
if (!preg_match(”/^[A-z0-9]{5,15}$/”, $name)) $error .= “<li class=\”errors\”>The Name field can only contain letters and numbers (no spaces) and can only be up to 15 characters long.</li>”; 만약 (! preg_match ("/^[ 한 - z0 - 9] (5,15 }$/", $ 이름)) $ 오류 .= "<li class=\"errors\">의 이름 필드는 문자를 포함할 수있는 유일한 와 숫자 (공백 없음)과 수있는 15 자까지 이상이어야합니다. </ 리튬> ";
In the preg_match I am checking that the name field only contains alphanumeric values (case insensitive) and needs to be at least 5 to 15 characters in length. 나는 그 이름 필드 (사건)과 길이에서 최소 둔감 영숫자 값이 포함되어 있어야합니다 5-15 문자 확인 오전 preg_match 있음.If you don’t meet that specification appropriate text is added to $error. 그 사양에 부합하지 않는 경우 적절한 텍스트 달러에 오류가 추가됩니다.
Using “[variable] [dot][equals] [text]” in this fashion allows me to keep an ongoing variable that I’m adding to. "[변수]를 사용하여 [] 도트 [동등] [문자]"이 패션에 내가 더 추가 해요 변수를 계속 진행하실 수있습니다.I can then check to see if $error contains any data before my script does any significant queries. 그때 경우 오류를 확인할 수있습니다 달러하기 전에 제 대본 모든 데이터를 포함하는 모든 중요한 쿼리 않습니다.If there are errors you can spit them out by echoing $error and ask the user to correct them. 혹시라도 오류가 $ 메아리와 사용자 요구에 의해이를 해결할 수있는 오류들을 뱉어있다.I then use CSS to style my errors which you can see with class=\”errors\”. 그때는 CSS 스타일을 내 오류 수업과 함께 = \ "라는 에러 메시지를 볼 수있다 \"를 사용합니다.
Regular expressions defiantly have a learning curve on them but they are one of the best tools that can help simplify your life in a variety of situations. 정규식이란 그들에 대한 학습 곡선도하지만 그들은 최고의 도구 중 하나는 다양한 상황에서 귀하의 인생을 단순화 할 수있다.I’ll go into more detail about them down the road but for now you may want to buy a book or do some Googling. 좀 더 구체적으로 그들에 대해 길을 따라간다하지만 지금은 당신이 원하는 도서를 구매 또는 일부를 검색 할 수있습니다.
The Non-Technical Recap비 - 기술 정리해보 -Implement a CAPTCHA script. - captcha를 스크립트를 구현합니다. -Escape slashes (and other bad characters). - (다른 나쁜 자) 슬래시 탈출했다. -Check to see if data is coming to your form using the correct method. 만약 올바른 방법을 사용하여 데이터를 해당 양식에오고 - 있는지 확인하십시오. -Check to see if the request is originating from your own server. -가 요청하여 자신의 서버에서 발생되어 있는지 확인하십시오. -Check data using a regular expression. - 정규 표현식을 사용하여 데이터를 확인합니다.
This is just the tip of the iceberg for what I can tell you about spam. 이 스팸 메일에 대해 무엇을 말할 수에 대한 빙산의 일각이다.Thats why I’ve decided to make a mini series of it. 그래서 나는 그것의 미니 시리즈를 제작하기로 결정했습니다.Over the next couple weeks I will be bringing you more detailed ways I deal with spam. 스팸 메일과의 거래보다 자세한 방법은 다음 몇 주 동안 당신을 데려됩니다.Comment below or email me about your own spam preventative methods. 코멘트를 아래에 등록하거나 자신의 스팸 메일 예방 방법에 대해 나와있다.If it is a new or unique technique I will post it in a future blog along with a link back to your blog. 만일 내가 미래를 블로그에 링크를 다시 귀하의 블로그에 게시할 예정입니다과 함께 신규 또는 독특한 기법이다.Just write in the comments below and include your URL in the website field. 바로 아래에 덧글로 작성하고 입력란에 웹사이트 URL을 포함합니다.
It just occured to me…setting up those if statements with a die() statement might be easier for a quick and dirty method. 그냥 제가 생각하기에는 ... 그 설정을하는 경우 () 성명 성명 죽을 함께 신속하고 더러운 방법에 대한 더 쉬울 수도있습니다.Which I’m sure most of you at least for now would want a quickfix to just toss in. Keep that in mind…Something like this: 이는 물론 대부분에요 적어도 지금은 그저 당신의 토스에게 원하는 것이 들어 quickfix이 그 마음에 ... 뭔가처럼 계속 :
if ($_SERVER[‘REQUEST_METHOD’] !== ‘POST’) { die(”The form can not be used like that”); } ($ _SERVER는 경우 [ 'REQUEST_METHOD']! == '게시물') (( "양식")을 사용하실 수없습니다 죽는;)
You can put that anywhere at the beginning of a script for it to take effect without worrying about existing code too much. 넣을 수있는 스크립트의 시작을 어디에 대한 기존의 코드에 대해 너무 많이 걱정없이 적용합니다.
Danny Cooper : I have a blog in a very rare niche, most people, around 80%, who search for it...대니 쿠퍼 : 난 아주 드문 틈새 시장에서 블로그가 대부분의 사람들은 누구에 대한 검색의 약 80 %, ...- [Go To Post]- 포스트로 이동 []
Todd : A good point you made by “Make yourself easily reachable.토드 : "로 만들면서 자신을 쉽게 접속할 수 좋은 지적합니다.One of your biggest... 한 너의 최고의 ...- [Go To Post]- 포스트로 이동 []
Streaming live AT http://toddrecommends.tv/live/ 라이브 스트리밍은 AT http://toddrecommends.tv/live/
Off to hang out with @sclemens @toddkedwards and @payneb 끄기 toddkedwards과 payneb @ @ @ sclemens들과 어울리고
Ha. 하.Debugging a site and found this from a previous developer: "This makes no sense but hopefully will never be executed." 디버깅 및 이전 개발자 사이트에서 제공하는이 발견 : "이것은 말이 안되고 잘하면 실행되지 않습니다.":-\ : - \
Ahh, free shwag. 아, 무료 shwag.Why didnt I start RobMalon.Com sooner =) 내가 왜 진작 시작 RobMalon.Com 그냥 =)
Way to drive your testing team nuts: Make a form's "Go" button produce different behavior from even/odd cords of where they clicked on it =) 귀하의 테스트 방식으로 팀을 미치게 : 양식의 "이동"버튼도 다른 행동을 생산 /의 이상한 코드를 어디에 =)를 클릭하십시오
@leolaporte Hi Leo =) @ leolaporte 안녕 레오 =)
How I'm making more money from a site that is decreasing in traffic and maintaining the same eCPM & CTR. 내가 어떻게 교통 체증 감소와 같은 유효 CPM & 클릭률을 유지하는 사이트에서 더 많은 돈을 만들고있어.Google Analytics, you lie... Google Analytics는, 당신은 거짓말을 ...
그냥 제가 생각하기에는 ... 그 설정을하는 경우 () 성명 성명 죽을 함께 신속하고 더러운 방법에 대한 더 쉬울 수도있습니다. 이는 물론 대부분에요 적어도 지금은 그저 당신의 토스에게 원하는 것이 들어 quickfix이 그 마음에 ... 뭔가처럼 계속 :
($ _SERVER는 경우 [ 'REQUEST_METHOD']! == '게시물') (( "양식")을 사용하실 수없습니다 죽는;)
넣을 수있는 스크립트의 시작을 어디에 대한 기존의 코드에 대해 너무 많이 걱정없이 적용합니다.