setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbcon->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); }catch (PDOExpection $e){ echo $e->getMessage(); } $stmt = $dbcon->prepare("SELECT username FROM users WHERE `lastIP`=:ip ORDER BY id DESC LIMIT 1"); $stmt->bindParam(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR); $stmt->execute(); $result = $stmt->fetch(PDO::FETCH_ASSOC); $url = "https://canary.discordapp.com/api/webhooks/x/x"; $dataArray = array('content' => "[Username (assumed): **".$result['username']."**] ".$message, 'username' => "Exploiter Alert"); $httpOptions = array( 'http' => array ( 'header' => "Graphictoria-Server", 'content-type' => 'multipart/form-data', 'method' => "POST", 'content' => http_build_query($dataArray) ) ); $context = stream_context_create($httpOptions); $result = @file_get_contents($url, false, $context); echo 'success'; $dbcon = null; ?>