Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
ã2021/10/15 追è¨ã ãã®è¨äºã¯æ´æ°ãåæ¢ããã¦ãã¾ããç¾å¨ã§ã¯çè ã®ææ³ãå¤åãã¦ããé¢ãããã¾ãã®ã§ï¼éå»ã®è¨äºã¨ãã¦åèç¨åº¦ã«ã覧ãã ããã CSRFããã³ãã®å¯¾çã®ä»çµã¿ã«é¢ãã¦ã¯ãã¡ãâ ããã§å®ç§ï¼ä»ããæ¯ãè¿ã CSRF 対çã¨åä¸ãªãªã¸ã³ããªã·ã¼ã®åºç¤ - Qiita ãã®è¨äºã¯ï¼PHPã«ãããã¯ã³ã¿ã¤ã ãã¼ã¯ã³ãç¨ããå®è£ ä¾ã示ããã®ã§ããå·çæ¥ãå°ã å¤ããã®ã«ãªãã®ã§ãäºæ¿ãã ããã ã³ã¡ã³ãæ¬ã®è°è«ã«é¢ããã¾ã¨ã 以ä¸ï¼XSSèå¼±æ§ãåå¨ããªãåæï¼ãã®èå¼±æ§ãããã¨ããããCSRF対çãã»ã¨ãã©æå³ããªããªããªãã®ã§ï¼ã¾ãããããæ½°ãã¦ãããã¨ï¼ ã»ãã·ã§ã³åºå®æ»æã«å¯¾ãã対ç ãã°ã¤ã³å¾ã«session_regenerate_idãå¿ ãå®è¡ããï¼ ãã°ã¢ã¦ãå¾ã«session_destroyãå¿ ãå®è¡ããï¼ CSRFæ»æã«å¯¾ãã対ç ã»ãã·ã§ã³IDãæã
PHPã«ã³ãã¡ã¬ã³ã¹é¢è¥¿2015ã«è¡ã£ã¦ãã¾ããã ä»åããå ´æãå¤ãã£ãããåã®ææåã ã£ããã¨ã¹ã¿ããã®çããã¯è²ã ã¨å¤§å¤ã ã£ããã¨æãã¾ããæ¬å½ã«ãããã¨ããããã¾ããã ä»åã¯ã»ãã·ã§ã³ã®ãã©ãã¯ã5æ¬ã§ãå 容çã«ãåå¿è ç¨ããæ¿ããã®ã¾ã§å å®ãã¦ãããé常ã«æºè¶³ã§ãã¾ããã è¦ãããªãã£ããã©æ°ã«ãªãã»ãã·ã§ã³ãæ°å¤ãããã¾ããã®ã§ããããã§å ¬éããã¦ããã»ãã·ã§ã³ã®ã¹ã©ã¤ããã¾ã¨ãã¦ã¿ã¾ããã ã¨ããããè¦ã¤ãããããã®ãæ²è¼ããã¦é ãã¦ããã¾ãããããããã¢ããããããã®çããããã¨æãã¾ãã®ã§ãã¾ãè¦ã¤ã次第æ´æ°ããã¦é ãã¾ãã ã»ãã·ã§ã³ã®ã¹ã©ã¤ã åºèª¿è¬æ¼ãPHPï¼ã§å¤ããã㨠è¨èªä»æ§ã¨ã¨ã³ã¸ã³ã®æ¹åãã¤ã³ãã PHP7ã§å¤ããã㨠ââè¨èªä»æ§ã¨ã¨ã³ã¸ã³ã®æ¹åãã¤ã³ã from Yoshio Hanawa www.slideshare.net ãããã°ã¦ã§ã¼ãå°æ¥ï¼
<?php $targets = array(500,300,100,99,1); // æ½é¸å¯¾è±¡ $sum = array_sum($targets); // ã¬ã¼ãåè¨ $total = 0; // ã¬ã¼ãç´¯è¨ $rand = rand(1, $sum); // ä¹±æ° foreach($targets as $key => $value) { $total += $value; if ($rand <= $total) { $result = $key; break; } } echo $result; // æ½é¸çµæï¼$targetsã®æ·»åï¼ è£è¶³ï¼ ã»$sumã100ã«ãªãããã«èª¿æ´ããã°1%ããã¿ã1000ã§ããã°0.1%ããã¿ã®ã¬ã¼ãã«ãªã ã»rand(1, $sum)ã®éå§ä½ç½®ãã¹ã©ã¤ãããäºã«ãããæ½é¸è£æ£ãªã©ãã§ãããä¾ï¼rand($sum,$sumï¼ã§100%
Captcha security check reoto.com is for sale Please prove you're not a robot View Price Processing
2012å¹´7æ13æ¥éææ¥ [PHP] åºç¾çã«åãã®ããã©ã³ãã ãªæ°åã®ä½ãæ¹ çããé£ç¶æ´æ°ãªã¿ãã¨ã§ããããã«ã¡ã¯ï¼ããã«ã¡ã¯ï¼ PHPã«ã¯ä¹±æ°ãçºçããã rand() ãããã¯mt_rand() é¢æ°ãããã¾ããã éã¿ä»ãã©ã³ãã æ°ãåºç¾çã«åãã®ããã©ã³ãã æ°ãçºçãããé¢æ°ãè¦å½ããã¾ãã(å½ç¤¾è¦³æ¸¬ã«åºã¥ã) ãããæ¨ä»ã§ã¯ã½ã¼ã·ã£ã«ã²ã¼ã ã«ä»£è¡¨ãããã²ã¼ã ã®è£å´ã«PHPãç¨ãããããã¨ãå¤ãããã§ã ãã¾ã©ããã¬ãã£ã ã®ãã¡ã¼ã¸è¨ç®ã ã®(ãã©ã¯ã¨çãª)ã¬ãã«ã¢ãããã¼ãã¹ã ã®ãã²ã¼ã ç³»ã§ã¯å¿ é ã®é¢æ°ã¨ãªãã¾ãã ã¨ããããã§ãã·ã³ãã«ãªãåºç¾çã«åãã®ããã©ã³ãã æ°ãçºçãããããã°ã©ã ã2種é¡ç´¹ä» è¶ ã·ã³ãã«ç ã¾ãã¯ãè¶ ã·ã³ãã«ãªãã®ãã $weighted_rand = mt_rand(1, mt_rand(1, 100)); ã¯ããããã ãã§ãã ã¨ãã£ã¦ãããª
'Eclipse for PHP Developers' All-In-Oneããã±ã¼ã¸ã«ã¯RSEãå«ã¾ãã¦ãã¾ãããä½æ ãCoreã ããªã®ãå°ãã¢ã(?)ã 1. Help > Install New Softwareã§Heliosãé¸æãããRemote System Explorer End-User Runtimeããã¤ã³ã¹ãã¼ã« 2. Remote System Explorerãã¼ã¹ãã¯ãã£ããéããConnectionã追å - New > Connectionã§æ¥ç¶ã¿ã¤ãï¼ä¾ãã°UbuntuãªãSSH Onlyã§ååãã¨ï¼ãé¸æãã¦ãµã¼ãã¼ã®ãã¹ãåorIPã¢ãã¬ã¹çãå ¥åãã¦Finish ããã ãã§ãããªã¢ã¼ããã·ã³ã®ãã¡ã¤ã«ãEclipseããEclipseã®ã¨ãã£ã¿ã§èªç±ã«ï¼ããpermissionç¸ãã¯ãããã©ï¼éããã®ã§ä¾¿å©ã§ãï½ PHPãã¡ã¤ã«ãPHPã¨ãã£ã¿ã§
1.Eclipseã¨PDTã®All in oneããã±ã¼ã¸ããã¦ã³ãã¼ã http://www.eclipse.org/pdt/ 2.æ¥æ¬èªåãã©ã°ã¤ã³Pleadesæ¬ä½ããã¦ã³ãã¼ããã¦Eclipseã«é©ç¨ http://mergedoc.sourceforge.jp/#pleiades.html 3.SSHæ¥ç¶ãã©ã°ã¤ã³ã®RSEãã¤ã³ã¹ãã¼ã« http://www.eclipse.org/dsdp/tm/ ãã©ã°ã¤ã³ã®ã¤ã³ã¹ãã¼ã« PTDã®All in oneãããªãã¦ãã¤ã³ã¹ãã¼ã«æ¸ã¿ã ã£ãç´ Eclipseã«ãã©ã°ã¤ã³è¿½å ããæ¹éã«å¤æ´ããã Eclipseã®æ©è½ã§ã¤ã³ã¹ãã¼ã«ããã¨ä¾åé¢ä¿è§£æ±ºãã¦ããããã ãããã¤ã³ã¹ãã¼ã«æé ã®æ¸ããããµã¤ããè¦ãã¨ä½åãzipè½ã¨ãã¦ãã®ã§é¢åãããã¨æã£ã¦ãã£ã¡ã«ããã Pleadesã¯ã¤ã³ã¹ãã¼ã«æ¸ã¿ã¨ãã¦ä»¥ä¸æé ã ãã«ã > æ°è¦ã½ãã
æ¦è¦ vimã¨ãã£ã¿ã®è¨å®ãã¡ã¤ã«ã§ãè¾æ¸ãã¡ã¤ã«ããæå®ãã¦ããã¨ã ãã®è¾æ¸ãã¡ã¤ã«ã使ç¨ãã¦ãå ¥åè£å®æ¤ç´¢ãããã¨ãã§ãã¾ãã ãã®è¨äºã§ã¯ãã®è¾æ¸ãã¡ã¤ã«ã®ä½¿ãæ¹ããã Javaç¨ã®è¾æ¸ãã¡ã¤ã«ã®ä½¿ãæ¹ã¾ã§ãæ±ãã¾ãã ã¤ã³ã¹ãã¼ã«æ¹æ³ ã¾ããè¾æ¸ãã¡ã¤ã«ãç¨æãã¾ãã è¾æ¸ãã¡ã¤ã«ã®ä¸èº«ã¯ã è£å®ã«ä½¿ããã¼ã¯ã¼ãããæ¹è¡ã§åºåã£ã¦å ¥ãããã®ã§ãã è¾æ¸ãã¡ã¤ã«ã®ä¸èº«ã®ä¾ const continue default do else extends false final è¾æ¸ãã¡ã¤ã«ãç¨æããããVimã®è¨å®ãã¡ã¤ã«_vimrc㫠以ä¸ã®ããã«è¨å®ãæ¸ãããã§ãã ããã è¾æ¸ãã¡ã¤ã«ããj2se131.dictãã¨ããååã§ããæã®è¨å®ä¾ã§ãã " è¨å®ä¾ :set dictionary=j2se131.dict ãã¡ã¤ã«ã®ç¨®é¡ã«å¿ãã¦ãè¾æ¸ãã¡ã¤ã«ãå¤ãããã®ã§ããã°ã 以ä¸ã®
vimã§PHPã®æ§æãã§ãã¯ãã§ããªããã®ãã¨æã£ã¦èª¿ã¹ãããæ¡ã®å®ã§ãã¾ããã .vimrcã«ä»¥ä¸ãè¨è¿°ãã¦ãã,lããå ¥åããã°æ§æãã§ãã¯ãã§ãã¾ãã "" " PHP Lint nmap ,l :call PHPLint()<CR> " " " PHPLint " " @author halt feits <halt.feits at gmail.com> " function PHPLint() let result = system( &ft . ' -l ' . bufname("")) echo result endfunction ä¾ãã°ã以ä¸ã®ã½ã¼ã¹ã 3è¡ç®ã®)ã足ããªãã§ãããï¼ãããããããã¾ãï¼ 1 <?php 2 $str = 'hello'; 3 if (empty($str) { 4 echo $hello; 5 } 6 ?> :wã§ä¿åãããã¨ã«ãã,l
ååã¯è©±ã ãã§çµãã£ã¦ãã¾ã£ãã®ã§ãä»åã¯ã½ã¼ã¹ã³ã¼ãä¸å¿ã§ãã ã¢ã¤ãã å士ã®è·é¢ã®è¨ç®ã«å¿ è¦ãªæ å ±ãåºåããReducerãå®è£ ãã ã¨ãã訳ã§æ©éã§ãããåå延ã ã¨è©±ããã¦ããäºãReducerã«å®è£ ãã¾ãã #!/usr/bin/php <?php require_once(dirname(dirname(__FILE__)).'/lib/HadoopStreaming/Reducer.php'); class Reducer extends HadoopStreaming_Reducer { public function reduce ( $key, $values ) { $wordcount = array(); while ( $values->has_next_value ) { list($id, $count) = explode(':', $values->cur
php.jsã¯JavaScriptã§ä½ãããPHP VMã§ããPHPã³ã¼ããJavaScriptã«å¤æãã¦å®è¡ãã¾ãã ä¸ã®ä¸ã«ã¯è²ã å¤ãã£ããã¨ãèãã人ããã¾ããWebãã©ã¦ã¶ã§ããã©ã«ãã§å®è¡ã§ããããã°ã©ãã³ã°è¨èªãJavaScriptã ããªãã¦è¨±ãããããããèããPHPããã°ã©ãã¼ãçã¿åºããã®ãphp.jsã§ãããã®åã®éããPHPã®å®è¡ã¨ã³ã¸ã³ãJavaScriptã«å®è£ ããã¨ããã¨ãã§ããªãã½ããã¦ã§ã¢ã«ãªãã¾ãã 確ãã«å®è¡ã§ãã¦ãã¾ããPHPã®ã³ã¼ãããJavaScriptã«å¤æãè¡ã£ã¦ããããã§ãã é åãã¯ã©ã¹ããã«var_dumpã¾ã§å®è£ ããã¦ããã®ãèå³æ·±ãã§ãã ããªãçªã£è¾¼ãã PHPã®å¦çãã§ãã¦ãã模æ§ã§ããããã¯é¢ç½ãã ããã«ã¯ãªã¼ãã®ä¸ã«å¤æ°ãå ¥ãã¦æ®éã«åºåã§ãã¦ããã®ãèå³æ·±ãã§ãã php.jsã§ã¯PHPã®ã³ã¼ãããã®ã¾ã¾å®è¡ã§ãã¾ãï¼ãã¡ã
ãã¦å¤ããã£ã¦ãã¾ãããå¤ã¨è¨ãã°PHPã¨ãããã¨ã§ãæ¨å¹´ã«å¼ãç¶ããæè¿ã®PHPäºæ ããç´¹ä»ã 1. PHP5.4ãªãªã¼ã¹ PHP5.4ã2012å¹´3æã«ãªãªã¼ã¹ããã¾ããã Traits ã Short array syntaxï¼é åã®ç縮æ§æï¼ãarray dereferencingï¼foo()[0]ï¼ ãªã©ã®PHPè¨èªæ¡å¼µãPHPã³ãã³ãã§èµ·åãããã«ãã¤ã³ãµã¼ããããã¦ããã©ã¼ãã³ã¹ã®æ¹åãªã©å¤§ããªå¤æ´ãå ãããã¦ãã¾ãã è¨èªèªä½ã®æ©è½è¿½å ã注ç®ã§ããããã«ãã¤ã³ãµã¼ãã¯å¤ãã®äººã«ã¨ã£ã¦ã¡ãªããã«ãªãã§ããããããã使ãã°PHPã¢ããªã±ã¼ã·ã§ã³ã®åä½ç¢ºèªã®ããã«Apacheãnginxãªã©ã®httpdãµã¼ããèªåã®PCã«å ¥ããå¿ è¦ã¯ããã¾ããã ä¸è¨ã®ãããªã³ãã³ããæã¤ã ãã§ããã«ãã¤ã³ãµã¼ããèµ·åãã¾ããæ°ãããã¬ã¼ã ã¯ã¼ã¯ãã©ã¤ãã©ãªãã¢ããªã±ã¼ã·ã§ã³ã試ãã¦ã¿ããæã«æ
Apacheã®ã¤ã³ã¹ãã¼ã« ~~~ $ yum install httpd ~~~ PHP5.3ç³»ã»MySQL5.1ç³»ã®ã¤ã³ã¹ãã¼ã« å¿ è¦ãªå¤é¨ãªãã¸ããªã追å ãã(2011/1/19æ¥æç¹ã®ãã¼ã¸ã§ã³) ~~~ wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm ~~~ [20120322追è¨]downloadå ã®urlãå¤ãã£ãæ°ããã¾ãï¼ English : Repository Configuration â Les RPM de Remi â Blog é
è¨å®ãã¡ã¤ã«ã§ã«ã¹ã¿ãã¤ãº vimã¨ãã£ã¿ã¯ãè¨å®ãã¡ã¤ã«.vimrcãç¨ãã¦ã«ã¹ã¿ãã¤ãºããäºãå¯è½ã§ãã ã¨ãã£ã¿è¨å®æ¹æ³ vimã®ã³ãã³ãã¢ã¼ãã§ã:(ã³ãã³è¨å·)ã®å¾ã«è¨å®ãå ¥åããã¨ããã®è¨å®ãã¨ãã£ã¿ã«åæ ããã¾ãã ä¾ãã°ã:set hlsearchã¨å ¥åãã¦ããã/ã§æ¤ç´¢ããã¨ãæ¤ç´¢èªããã¤ã©ã¤ãããã¾ãã è¨å®ãã¡ã¤ã«ã«è¨è¿° ä¸è¿°ã®æ¹æ³ã§ãã³ãã³ãã¢ã¼ãã§è¨å®ããå ´åãvimãåèµ·åããã¨ãã®è¨å®ã¯ç¡å¹ã«ãªãã¾ãããã®ãããèµ·åãã度ã«è¨å®ããå¿ è¦ãããã¾ãããããã¯é¢åã§ããã vimã§ã¯ã.vimrcã¨ããååã®ãã¡ã¤ã«ã«èªåç¨ã®è¨å®ãè¨è¿°ãã¦ããã¨ãã¨ãã£ã¿èµ·åæã«è¨å®ãèªã¿è¾¼ãã§ããã¾ãã .vimrcã§ã¯ã"(ããã«ã¯ã©ã¼ã)ã§å§ã¾ãè¡ã¯ã³ã¡ã³ãæ±ãã«ãªãã¾ãã è¤éãªè¨å®ãããå ´åã¯ãã³ã¡ã³ããæ®ãã¦ããã¨ãå¾ã å½¹ç«ã¤ããããã¾ããã PHPeråãè¨å® ç§èª
æ°åããåããéæ»ã§ããã°ã©ãã³ã°ããã¹ã¿ã¼ã§ããvimãã©ã°ã¤ã³ãquickrunã 2011å¹´04æ25æ¥- æ°åããåããéæ»ã§ããã°ã©ãã³ã°ããã¹ã¿ã¼ã§ããvimãã©ã°ã¤ã³ãquickrunãã ãã®æ¥ãä¼ç¤¾ã«å ¥ã£ã¦ããµã¼ãã«å ¥ã£ã¦ vim ã§ããã°ã©ãã³ã°ããããã¦ãã人ã¯ãããªãã«ãããã§ããããã®å ´åã«éæ»ã§ããã°ã©ãã³ã°ããã¹ã¿ã¼ã§ããquickrunãã©ã°ã¤ã³ãå ¥ãã¦ããã¾ãããã ããã°ã©ãã³ã°ãè¦ããã«ã¯ä½ã£ã¦åãããä¸çªããã§ããããæ¸ãã¦ãâãä¿åãã¦ãâãå®è¡ãã¦ããä¸ç¬ã§è¡ãã¾ãã å ·ä½çã«ã¯ããã°ã©ã ãæ¸ãã¦ãã¦ãã³ãã³ãã¢ã¼ãã§ãï¿¥r ããã¿ã¤ãããã ãã§ãã¤ã³ãåããã¦ããã°ã©ã ã®å®è¡çµæãå¾ããã¾ãã VPSãªã©ãåãã¦ãããããããã°ã©ãã³ã°ãã¯ããããã£ã¦æ¹ã«ãæå¹ã§ãã ããªãã¤ã³ã¹ã¿ã³ãã«å®è¡ã§ããã®ã§ãããæ¸ãã¨ããåºããããµã¯ãµã¯é²ãããã
æ¥ã¨ãããã¨ã§ãAmazon Web Servicesï¼AWSï¼ãã¯ããã¦ã¿ã¾ãããã AWSçãä¸ãã£ã¦ãã¾ããã2011å¹´3æã«æ±äº¬ãªã¼ã¸ã§ã³ãã§ãããã¨ã§ããããã触ã£ã¦ã¿ããããªã¨ããPHPã¦ã¼ã¶ã®æ¹ãå¤ããã¨æãã¾ãã ãããªããªãã¸ãAWSãã¯ãããéã«å½¹ç«ã¤æ å ±ããç´¹ä»ã§ãã 1. AWSã¢ã«ã¦ã³ããæ°è¦ä½æãã¦ãEC2ã®å©ç¨ç³ãè¾¼ã¿ãè¡ã ã¾ãAWSã®ã¢ã«ã¦ã³ããä½æãã¦ãEC2ã®å©ç¨ç³ãè¾¼ã¿ãè¡ãã¾ãã æé ã«ã¤ãã¦ã¯ãAWSã¨ãã³ã¸ã§ãªã¹ãã® @KenTamagawa ãããæ¸ããã以ä¸ã®è³æãåèã«ãªãã¾ãããã®ã¨ããã«é²ãã¦ããã°ãããããåé¡ç¡ãã¨æãã¾ãã é²ããä¸ã§èªåãè©°ã¾ã£ãç¹ã¯ä»¥ä¸ã éµä¾¿çªå·ãé»è©±çªå·ã«ã¯ãã¤ãã³ã éµä¾¿çªå·ãé»è©±çªå·ã¯ãã¤ãã³ãå¿ è¦ãªã®ã§å ¥åããããã«ãã¦ä¸ããã æ¸å¼ã¯æ¥æ¬å½å ã®ãã®ãéµä¾¿çªå·8ã±ã¿ï¼ãã¤ãã³å ¥ãï¼ãé»è©±çªå·ã¯12ã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}