You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.php 673B

12345678910111213141516171819202122232425262728
  1. <?php
  2. require_once(__DIR__ . "/vendor/autoload.php");
  3. $dotenv = new Dotenv\Dotenv(__DIR__);
  4. $dotenv->load();
  5. header('Content-Type: text/html; charset=iso-8859');
  6. $cookie = new \GuzzleHttp\Cookie\SetCookie([
  7. 'Name' => 'PHPSESSID',
  8. 'Value' => getenv('SESSION'),
  9. 'Domain' => 'wprodl.uqac.ca'
  10. ]);
  11. $jar = new \GuzzleHttp\Cookie\CookieJar(true);
  12. $jar->setCookie($cookie);
  13. $client = new GuzzleHttp\Client(['cookies' => true]);
  14. $response = $client->request('POST', 'https://wprodl.uqac.ca/dossier_etudiant/grille_horaire.html?type=gl', [
  15. 'cookies' => $jar,
  16. 'form_params' => [
  17. 'session' => getenv('PERIOD')
  18. ]
  19. ]);
  20. echo (string)$response->getBody();