<?php include_once 'classes/EDAPI.php'; include_once 'classes/Utils.php'; $api = new EDAPI(); $code = isset($_POST['code']) ? $_POST['code'] : ''; $errors = array(); if ($code) { $info = $api->confirm($code); if (endsWith($info['redirect_url'], '.net/')) { header('Location: index.php'); } else { $errors[] = "Code incorrect"; } } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ED Companion</title> </head> <body> <?php if (sizeof($errors)) { echo '<h3>Errors</h3><ul>'; foreach ($errors as $error) { echo '<li>' . $error . '</li>'; } echo '</ul>';