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]

Create shortcut links using Google API

I needed a short link, so I made it PHP. You can use it after registering Google API. How to use: Shortur_google ('original address', 'API key'); <? PHP Function Shortur_google ($ URL, $ Key) { $ post = array ('LONGURL' => $ URL); $ json = json_encode ($ post); $ curlobj = curl_init (); curl_setopt ($ curlobj, curlopt_url, 'https://www.googleapis.com/urlshortener/v1/url?key='..nkey); CURL_SETOPT ($ curlobj, curlopt_returntransfer, 1); CURL_SETOPT ($ curlobj, curlopt_ssl_verifypeer, 0); CURL_SETOPT ($ curlobj, curlopt_Header, 0); curl_setopt ($ curlobj, curlopt_httpHeader, Array ('Content-Type: Application/JSON' '); CURL_SETOPT ($ curlobj, curlopt_post, 1); CURL_SETOPT ($ curlobj, curlopt_postfields, $ json); $ json = json_decode (curl_exec ($ curlobj)); curl_close ($ curlobj); return $ json-> ID; } Echo Shortur_google ('http://kalmuri.kilho.net/', 'API-KEY-API-KEY-Api-Key'); ?>

Advertisement using the tenting API

Tenping advertisements are shown on Facebook, so I will write it as a test and PHP. Through the revenue ranking within the tenting site, if you think about the total sales, you can operate for a long time; If you have a good performance after the test, we will write a number of methods using tenting (click optimization, etc.). (* Source is only for those who registered as seniors ㅎㅎ) Anyway, this is an example of printing using Tenping API. Tenping subscription "http://tenping.kr/api" ...

Modify the WordPress theme

It is a method of modifying the file that is backed up (represented by a child theme) without touching the original when modifying the WordPress theme. To easily check the children theme used, create a new folder in the "WP-Content/Theme" folder by combining the theme name. Copy the "Style.css" of the original theme to the child theme folder and "Theme Name", "Themplate" as below ...