Skip to content

Instantly share code, notes, and snippets.

View NotClynt's full-sized avatar
🚬
Yeah i think i'm cool

Clynt NotClynt

🚬
Yeah i think i'm cool
View GitHub Profile
@Jengas
Jengas / index.php
Last active February 11, 2025 18:05
Discord oauth2 example PHP
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('max_execution_time', 300); //300 seconds = 5 minutes. In case if your CURL is slow and is loading too much (Can be IPv6 problem)
error_reporting(E_ALL);
define('OAUTH2_CLIENT_ID', '1234567890');
define('OAUTH2_CLIENT_SECRET', 'verysecretclientcode');
<form action='newsletter.php' method='post'>
<div class="stuff">Email <input type="text" name='email'>
<button type="submit" name='submit' >Submit</button> <br></div>
<?php if ($result) {echo $result ; } ?>
</form>