31 lines
630 B
PHP
31 lines
630 B
PHP
<?php
|
|
|
|
|
|
$pauline = hash('sha256', 'srifi');
|
|
|
|
|
|
$curl = curl_init();
|
|
curl_setopt_array($curl, array(
|
|
CURLOPT_RETURNTRANSFER => 1,
|
|
CURLOPT_URL => "http://recettesiam9.cstb.fr/api-cours/get-hash.php?file=applejack.txt"
|
|
));
|
|
|
|
$ret = curl_exec($curl);
|
|
$tab = json_decode($ret);
|
|
$file = $tab -> hash;
|
|
|
|
curl_close($curl);
|
|
|
|
$curl2 = curl_init();
|
|
curl_setopt_array($curl2, array(
|
|
CURLOPT_RETURNTRANSFER => 1,
|
|
CURLOPT_URL => "http://recettesiam9.cstb.fr/api-cours/update-jeton.php?file=$file&user=$pauline"
|
|
));
|
|
$resultsJson = curl_exec($curl2);
|
|
|
|
curl_close($curl2);
|
|
|
|
$results = json_decode($resultsJson);
|
|
|
|
print_r($results);
|