Tag - PHP

Php short tag change program

It is a program that changes a short tag (<?) From a PHP file. If it's a changed file, the original file adds .bak to the extension. <= $ Hello?> $ hello; It is changed to.> If you use the options (-S), <? = Does not change. How to use ConvertShortopentag.exe [Option]{File name or folder name} Download Download from Kilhonet Related links Source: https://github.com/newkilho/convertshortopentag license Kalmuri is freeWare. Even if you use your company, home, government offices, and schools without any space restrictions ...

Finding the current location (PHP)

The location is obtained through the Geolocation function, and if it is a browser that is not related or supported, the location is obtained with the IPI through the API provided by Naver. Before use, get Naver's API key to the address below (https://www.ncloud.com/product/applicationService/geolocation) <? Function Makesignature ($ Secretkey, $ Method, $ Basestring, $ Timestamp, $ AccessKey) { $ space = '; $ newline = "\ n"; $ hmac = $ method. $ space. $ baseString. $ signaute = base64_encode (hash_hmac ('SHA256', $ HMAC, $ Secretkey, True)); return $ signaute; } if ($ _ POST ['ORDER'] == 'geolocation') { $hostNameUrl = 'https://geolocation.apigw.ntruss.com'; $requestUrl= '/geolocation/v2/geoLocation'; $accessKey...

Find an IP access from AWS (PHP)

When you use the Amazon server, if you get a server IP, the private IP is output. So I made it to save the official IP. <? if (in_array (Substr ($ _ Server ['Server_addr']], 0, 3), array('172'))) if(strrpos(gethostname(), '.compute.internal')!==false) $_SERVER['SERVER_ADDR'] = file_get_contents('http://169.254.169.254/latest/meta-data/public-ipv4'); echo $_SERVER['SERVER_ADDR']; ?>

Installation and use of morphological analysis (PHP)

Installation Environment: Centos7 Basic, php7 Yum Install GCC-C ++ Java-1.7.0-OPENJDK-Devel Python-Devel ZLIB-Devel OpenSSL-Devel Git-Y wget https://www.python.org/ftp/python/3.6.1/python-3.6.1.tgz TAR XF Python-3.* CD Python-3.* ./configure make Make Altinstall pip3.6 Install jpype1-Py3 PIP3.6 Install Konlpy CD .. wget https://bitbucket.org/eunjeon/mecab-ko/downloads/mecab-0.996-ko-0.2.tar.gz TAR ZXFV MECAB-0.996-KO-0.2.2.tar.gz CD Mecab-0.996-KO-0.9.2 ./configure make Make Install CD .. wget https://bitbucket.org/eunjeon/mecab-ko-dic/downloads/mecab-ko-dic-2.0.1-20150920.tar.gz TAR ZXFV MECAB-KO-DIC-2.0.1-20150920.tar.gz CD MECAB-KO-DIC-2.0.1-20150920 ./autogen.sh ./configure make Make Install CD/USR/Local/SRC/ git clone https://github.com/rsky/php-mecab.git CD/USR/LOCAL/SRC/PHP-MECAB/MECAB phpize ./configure --with-PHP-config =/usr/bin/php-config --with-mecab =/usr/local/bin/mecab-config make make test Make Install Echo "Extension = mecab.so"> /etc/php.d/mecab.ini Systemctl Restart httpd.service PHP ...

Web hacking, dangerous code check program

Server hacking was made to easily check whether the malicious PHP was installed, monitoring and risk code. Write the code on the server account and upload it. Click the download button below to download the monitoring program. Run the downloaded program and enter the URL written in (1) in the URL (S). Click Diagnose to tell you the suspected file name as shown below. Not usually ...

HTTP access information record

When using OpenAPI, it is to check whether the test and access information is properly Messos value, host, POST value when connecting[PHP] <? $log = $_SERVER['REQUEST_METHOD'].' '.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."nn"; foreach($_SERVER as $k => $v) { if($k=='HTTP_HOST') continue; if(substr($k, 0,5)!='HTTP_') continue; $log .= '$k: $v'."n"; } $log .= "n"; $post = array_map('urldecode', explode('&', file_get_contents('php://input'))); foreach($post as $v) { $log .= "$vn"; } $log .= "-----------------------------------n"; file_put_contents('log.txt', $log, FILE_APPEND | LOCK_EX); ?> [/PHP]