<commit_before><?php require_once("includes/session.php");?>
<?php require_once("includes/db_connection.php");?>
<?php require_once("includes/functions.php");?>
<?php
$username = $_GET['username'];
$code = $_GET['code'];
$query = "SELECT * FROM users WHERE username = '{$username}'";
$result = mysqli_query($conn, $query);
confirm_query($result);
while ($row = mysqli_fetch_assoc($result)) {
	$db_code = $row['confirm_code'];
}
if ($code==$db_code) {
	$query = "UPDATE users SET confirmed = '1', confirm_code = '0'";
    $result = mysqli_query($conn, $query);
    if ($result && mysqli_affected_rows($conn) == 1) {
       redirect_to("public/Inside/buzz.php");
    } else {
        $_SESSION["message"] = "Updation failed.";
    }
} else {
	echo "username and code does not match.";	
}
?>
<?php
if (isset ($conn)){
    mysqli_close($conn);
}
?><commit_msg>redirected to buzz after email confirmation<commit_after><?php require_once("includes/session.php");?>
<?php require_once("includes/db_connection.php");?>
<?php require_once("includes/functions.php");?>
<?php
$username = $_GET['username'];
$code = $_GET['code'];
$query = "SELECT * FROM users WHERE username = '{$username}'";
$result = mysqli_query($conn, $query);
confirm_query($result);
while ($row = mysqli_fetch_assoc($result)) {
	$db_code = $row['confirm_code'];
}
if ($code==$db_code) {
	$query = "UPDATE users SET confirmed = '1', confirm_code = '0'";
    $result = mysqli_query($conn, $query);
    if ($result && mysqli_affected_rows($conn) == 1) {
        $_SESSION["username"] = $username;
        redirect_to("public/Inside/buzz.php");            
    }
       
    } else {
        $_SESSION["message"] = "Updation failed.";
    }
} else {
	echo "username and code does not match.";	
}
?>
<?php
if (isset ($conn)){
    mysqli_close($conn);
}
?>
{'fraction_non_alphanumeric': 0.20143487858719647, 'fraction_numerical': 0.0033112582781456954, 'mean_word_length': 4.64797507788162, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '181413', 'n_tokens_mistral': 618, 'n_tokens_neox': 603, 'n_words': 131}