{"id":161635,"date":"2012-12-06T14:51:02","date_gmt":"2012-12-06T10:51:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=161635"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=161635","title":{"rendered":"<span class=\"post_title\">\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430 CAPTCHA \u0434\u043b\u044f Codeigniter<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/92d\/715\/c5f\/92d715c5fa007152a71ab712047c2e3c.jpg\"\/><br \/>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e, \u043e\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e \u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435, \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f <s>\u0443\u0431\u043e\u0433\u043e\u0433\u043e<\/s> \u0445\u0435\u043b\u043f\u0435\u0440\u0430 \u043a\u0430\u043f\u0447\u0438 \u0432 Codeigniter. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u0415\u0441\u043b\u0438 \u0412\u0430\u043c \u0434\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u043e\u043c, \u0442\u043e \u0412\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u043e\u043d \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u043f\u0447\u0438 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u0427\u0442\u043e, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043b\u0438\u0448\u043d\u0438\u043c \u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f\u043c \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438 <s>\u0441\u0431\u043e\u0440\u0430 \u043c\u0443\u0441\u043e\u0440\u0430<\/s> \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u043e\u0447\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/7dc\/846\/993\/7dc8469939a8a035014ddfde2fe0044d.jpg\"\/><br \/>  <i>\u0424\u0430\u0439\u043b\u044b \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/i><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u044d\u0442\u043e, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c <s>\u043a\u043e\u0441\u044f\u043a\u0438<\/s> \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043d\u0435 \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0435\u0451 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0432\u0432\u043e\u0434. \u0427\u0442\u043e, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043e\u0440\u0442\u0438\u0442 \u043d\u0435\u0440\u0432\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/150\/bb3\/95c\/150bb395c67b31874e8876a6868ca6b2.jpg\"\/><br \/>  <i>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 8 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u0432\u0438\u0434\u043d\u043e \u0432\u0441\u0435\u0433\u043e 6, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u201c\u0443\u0448\u043b\u0438\u201d \u0437\u0430 \u043f\u0440\u0430\u0432\u0443\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u0443.<\/i><\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430, \u043a\u0440\u043e\u043c\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435.<br \/>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432.<\/p>\n<p>  <b>\u0417\u0430\u0434\u0430\u0447\u0438:<\/b>  <\/p>\n<ol>\n<li>\u0423\u0431\u0440\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 \u0436\u0435\u0441\u0442\u043a\u0438\u0439 \u0434\u0438\u0441\u043a \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u0440\u044f\u043c\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440.<\/li>\n<li>\u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u044b\u0445\u043e\u0434\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0434\u043b\u0438\u043d\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u0440\u0430\u043c\u043a\u043e\u0439 \u0438 \u0431\u0435\u0437 \u0440\u0430\u043c\u043a\u0438.<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u044b, \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/li>\n<\/ol>\n<p>  <b>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/b>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">MY_captcha_helper.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">function create_captcha_stream($data = '') \t{ \t\t$defaults = array('word' =&gt; '', 'img_width' =&gt; 150, 'img_height' =&gt; 30, 'font_path' =&gt; '', 'random_str_length' =&gt; '5', 'border' =&gt; TRUE);  \t\tforeach ($defaults as $key =&gt; $val) \t\t{ \t\t\tif ( ! is_array($data)) \t\t\t{ \t\t\t\tif ( ! isset($$key) OR $$key == '') \t\t\t\t{ \t\t\t\t\t$$key = $val; \t\t\t\t} \t\t\t} \t\t\telse \t\t\t{ \t\t\t\t$$key = ( ! isset($data[$key])) ? $val : $data[$key]; \t\t\t} \t\t}    \t\tif ( ! extension_loaded('gd')) \t\t{ \t\t\treturn FALSE; \t\t}  \t\t \t\t\/\/ ----------------------------------- \t\t\/\/ Do we have a &quot;word&quot; yet? \t\t\/\/ -----------------------------------  \t   if ($word == '') \t   { \t\t\t$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; \t\t\t \t\t\t$str = ''; \t\t\tfor ($i = 0; $i &lt; $random_str_length; $i++) \t\t\t{ \t\t\t\t$str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); \t\t\t}  \t\t\t$word = $str; \t   }  \t\t\/\/ ----------------------------------- \t\t\/\/ Determine angle and position \t\t\/\/ -----------------------------------  \t\t$length\t= strlen($word); \t\t$angle\t= ($length &gt;= 6) ? rand(-($length-6), ($length-6)) : 0; \t\t$x_axis\t= rand(6, (360\/$length)-16); \t\t$y_axis = ($angle &gt;= 0 ) ? rand($img_height, $img_width) : rand(6, $img_height);  \t\t\/\/ ----------------------------------- \t\t\/\/ Create image \t\t\/\/ -----------------------------------  \t\tif (function_exists('imagecreatetruecolor')) \t\t{ \t\t\t$im = imagecreatetruecolor($img_width, $img_height); \t\t} \t\telse \t\t{ \t\t\t$im = imagecreate($img_width, $img_height); \t\t}  \t\t\/\/ ----------------------------------- \t\t\/\/  Assign colors \t\t\/\/ ----------------------------------- \t\t \t\t\/* RAND *\/ \t\t$red = rand(50, 100); \t\t$green = rand(50, 100); \t\t$blue = rand(50, 100);  \t\t$bg_color\t= imagecolorallocate($im, 255, 255, 255); \t\t$border_color\t= imagecolorallocate($im, $red, $green, $blue); \t\t$text_color\t= imagecolorallocate($im, $red+30, $green+30, $blue+30); \t\t$grid_color\t= imagecolorallocate($im, $red+60, $green+60, $blue+60); \t\t$shadow_color\t= imagecolorallocate($im, 255, 240, 240); \t\t \t\t  \t\t\/\/ ----------------------------------- \t\t\/\/  Create the rectangle \t\t\/\/ -----------------------------------  \t\tImageFilledRectangle($im, 0, 0, $img_width, $img_height, $bg_color);  \t\t\/\/ ----------------------------------- \t\t\/\/  Create the spiral pattern \t\t\/\/ -----------------------------------  \t\t$theta\t\t= 1; \t\t$thetac\t\t= 7; \t\t$radius\t\t= 16; \t\t$circles\t= 20; \t\t$points\t\t= 32;  \t\tfor ($i = 0; $i &lt; ($circles * $points) - 1; $i++) \t\t{ \t\t\t$theta = $theta + $thetac; \t\t\t$rad = $radius * ($i \/ $points ); \t\t\t$x = ($rad * cos($theta)) + $x_axis; \t\t\t$y = ($rad * sin($theta)) + $y_axis; \t\t\t$theta = $theta + $thetac; \t\t\t$rad1 = $radius * (($i + 1) \/ $points); \t\t\t$x1 = ($rad1 * cos($theta)) + $x_axis; \t\t\t$y1 = ($rad1 * sin($theta )) + $y_axis; \t\t\timageline($im, $x, $y, $x1, $y1, $grid_color); \t\t\t$theta = $theta - $thetac; \t\t}  \t\t\/\/ ----------------------------------- \t\t\/\/  Write the text \t\t\/\/ -----------------------------------  \t\t$use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE;  \t\tif ($use_font == FALSE) \t\t{ \t\t\t$font_size = 7; \t\t\t$x = rand(1, $img_width-(($length*$font_size)*2)); \t\t\t$y = 0; \t\t} \t\telse \t\t{ \t\t\t$font_size\t= 12; \t\t\t$x = rand(1, $img_width-($length*$font_size)); \t\t\t$y = $font_size+2; \t\t}  \t\tfor ($i = 0; $i &lt; strlen($word); $i++) \t\t{ \t\t\tif ($use_font == FALSE) \t\t\t{ \t\t\t\t$y = rand(1 , $img_height-($font_size*3)); \t\t\t\timagestring($im, $font_size, $x, $y, substr($word, $i, 1), $text_color); \t\t\t\t$x += ($font_size*2); \t\t\t} \t\t\telse \t\t\t{ \t\t\t\t$y = rand($font_size , $img_height-($font_size\/3)); \t\t\t\timagettftext($im, $font_size, $angle, $x, $y, $text_color, $font_path, substr($word, $i, 1)); \t\t\t\t$x += $font_size; \t\t\t} \t\t}   \t\t\/\/ ----------------------------------- \t\t\/\/  Create the border \t\t\/\/ -----------------------------------  \t\tif ($border == TRUE) \t\t{ \t\t\timagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color); \t\t}  \t\t\/\/ ----------------------------------- \t\t\/\/  Generate the image \t\t\/\/ ----------------------------------- \t\t \t\theader(&quot;Content-type: image\/jpeg&quot;); \t\tImageJPEG($im);  \t\tImageDestroy($im);  \t\treturn $word; \t} <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <i>\u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u044b\u043b\u0430 \u0432\u0437\u044f\u0442\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0430\u043f\u0447\u0438.<\/i><\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/b><br \/>  \u041a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c <a href=\"http:\/\/ellislab.com\/codeigniter\/user-guide\/general\/helpers.html\">\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430<\/a>, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"http:\/\/ellislab.com\/codeigniter\/user-guide\/\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Codeigniter<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442 \u0441\u044e\u0434\u0430 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043a\u0443\u0434\u0430 \u0432\u043f\u0438\u0441\u0430\u0442\u044c:  <\/p>\n<pre><code class=\"php\">$this-&gt;load-&gt;helper('captcha'); \t\t $prefs = array(\t\t\t\t\/\/ \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u0430\u043f\u0447\u0438, \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \t'word'\t =&gt; 'text',\t\t\/\/ \u0442\u0435\u043a\u0441\u0442 \t'img_width' =&gt; 100,\t\t\t\/\/ \u0448\u0438\u0440\u0438\u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f (int) \t'img_height' =&gt; 30,\t\t\t\/\/ \u0432\u044b\u0441\u043e\u0442\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f (int) \t'random_str_length' =&gt; 5,\t\t\/\/ \u0434\u043b\u0438\u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (int) \t'border' =&gt; FALSE,\t\t\t\/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u043c\u043a\u0443 (bool) \t'font_path' =&gt; 'path_to_.ttf'\t\/\/ \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0448\u0440\u0438\u0444\u0442\u0430 \t); \t\t $word = create_captcha_stream($prefs); $this-&gt;session-&gt;set_flashdata('word', $word); <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>create_captcha_stream<\/code> \u2013 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440.<br \/>  \u0421\u0442\u0440\u043e\u043a\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u0435\u0441\u0441\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c.<\/p>\n<p>  \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0448\u0430\u0431\u043b\u043e\u043d \u0441 \u0444\u043e\u0440\u043c\u043e\u0439, \u0433\u0434\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0430\u043f\u0447\u0430, \u0442\u0435\u0433: <br \/>  <code>&lt;img src=\u201d http:\/\/yoursite.com\/\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u201d \/&gt;<\/code><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/6b2\/bfd\/9bc\/6b2bfd9bca791ffc7bdf902cf0ff5e5f.jpg\"\/><br \/>  <i>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u0430\u043f\u0447\u0438<\/i><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u043a\u0430\u043f\u0447\u0438 \u0432 \u0441\u0435\u0441\u0438\u044e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0447\u0442\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u0430 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440.<\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:  <\/p>\n<pre><code class=\"php\">$captcha = trim($this-&gt;input-&gt;post('captcha')); \/\/ \u0442\u043e \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e \u0441 \u0444\u043e\u0440\u043c\u044b $word = $this-&gt;session-&gt;flashdata('word'); \/\/ \u0442\u043e \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e  if ($word == $captcha) { \techo &quot;Login sucsessfull&quot;; } else { \techo &quot;Bad login&quot;; } <\/code><\/pre>\n<p>  \u0423\u0431\u0440\u0430\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043d\u0438\u0436\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <code>strtolower()<\/code>.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043a\u0430\u043f\u0447\u0438, \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0438 \u0441\u0432\u0435\u0440\u0445\u044a\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e. \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/161635\/\"> http:\/\/habrahabr.ru\/post\/161635\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/92d\/715\/c5f\/92d715c5fa007152a71ab712047c2e3c.jpg\"\/><br \/>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e, \u043e\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e \u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435, \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f <s>\u0443\u0431\u043e\u0433\u043e\u0433\u043e<\/s> \u0445\u0435\u043b\u043f\u0435\u0440\u0430 \u043a\u0430\u043f\u0447\u0438 \u0432 Codeigniter.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-161635","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/161635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161635"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/161635\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}