12345678910111213141516171819202122232425262728 |
- <?php
-
- require_once(__DIR__ . "/vendor/autoload.php");
-
- $dotenv = new Dotenv\Dotenv(__DIR__);
- $dotenv->load();
-
- header('Content-Type: text/html; charset=iso-8859');
-
-
- $cookie = new \GuzzleHttp\Cookie\SetCookie([
- 'Name' => 'PHPSESSID',
- 'Value' => getenv('SESSION'),
- 'Domain' => 'wprodl.uqac.ca'
- ]);
-
- $jar = new \GuzzleHttp\Cookie\CookieJar(true);
- $jar->setCookie($cookie);
-
- $client = new GuzzleHttp\Client(['cookies' => true]);
-
- $response = $client->request('POST', 'https://wprodl.uqac.ca/dossier_etudiant/grille_horaire.html?type=gl', [
- 'cookies' => $jar,
- 'form_params' => [
- 'session' => getenv('PERIOD')
- ]
- ]);
- echo (string)$response->getBody();
|