No details? PhpfunctionC ($ key) {$ c_arrarray (kernel, DDOS_MEMCACHE_HOST127.0.0.1, restart apache to take effect ddos_memcache_port1_11. Restart apache to take effect DDOS_MEMCACHE_EXPIRE2,); retu
No details? Phpfunction C ($ key) {$ c_arr = array ('ddos _ MEMCACHE_PERSISTENT_ID_COUNT '= 200, 'ddos _ MEMCACHE_HOST' = '2017. 0.0.1 ', // you need to restart apache to take effect. 'ddos _ MEMCACHE_PORT' = 11211, // you need to restart apache to take effect. 'ddos _ MEMCACHE_EXPIRE '= 2,); retu
<无详细内容> <无>
200, 'ddos _ MEMCACHE_HOST '=>' 127. 0.0.1 ', // you need to restart apache to take effect 'ddos _ MEMCACHE_PORT' => 11211, // you need to restart apache to take effect 'ddos _ MEMCACHE_EXPIRE '=> 2 ,); return $ c_arr [$ key];} /*** @ brief isDdos judge whether it is a rapid ddos attack ** @ param $ index_arr ** @ return */function isDdos ($ index_arr) {$ persistent_id = mt_rand (1, C ('ddos _ MEMCACHE_PERSISTENT_ID_COUNT '); $ m = new Memcached ($ persistent_id); if (! $ M-> getServerList () {$ m-> addServer (C ('ddos _ MEMCACHE_HOST '), C ('ddos _ MEMCACHE_PORT '));} $ key = md5 (http_build_query ($ index_arr); $ ret = $ m-> get ($ key) === 1? True: false; $ m-> set ($ key, 1, C ('ddos _ MEMCACHE_EXPIRE '); return $ ret;} if (isDdos (array ('tjx ', 'fdf ') {echo 'ddos'; die ();} sleep (2); echo 'Return value ';