Title / Description
Code <?php $data = 'client_id=' . $_GET['client_id'] . '&client_secret=' . $_GET['client_secret'] . '&code=' . urlencode($_GET['code']); $curl = curl_init("https://github.com/login/oauth/access_token"); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); preg_match('/access_token=([0-9a-f]+)/', $response, $out); echo $out[1]; curl_close($curl); ?>
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code