tp3
This commit is contained in:
30
TD/TD3/e.php
Normal file
30
TD/TD3/e.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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);
|
Reference in New Issue
Block a user