<commit_before><?php
include("connect.php");
include('tables.php');
$_POST = array_map('strip_tags', $_POST);
$_POST = array_map('htmlspecialchars', $_POST);
//date format and time zone
date_default_timezone_set('America/New_York');
$date = date('l jS \of F Y h:i:s A');
$pid=$_GET['pid'];
$result = mysqli_query($con,"SELECT * FROM $table WHERE pid='$pid' ");
if( mysqli_num_rows($result) > 0) {
    print "updating...";
}
else
{
    $sql="INSERT INTO $table (pid) VALUES ('$pid')";
    if (!mysqli_query($con,$sql)) {
      die('Error: ' . mysqli_error($con));
    }
}
foreach($_GET as $key => $value) {
    echo 'Current value in $_GET["' . $key . '"] is : ' . $value . '<br>';
    $entry = mysqli_real_escape_string($con, $value);
    //$sql="UPDATE WHERE pid='$pid' $table ($key) VALUES ('$entry')";
    $sql="UPDATE $table SET $key='$entry' WHERE pid='$pid'";
    mysqli_query($con,$sql);
    //if (!mysqli_query($con,$sql)) {
    //  die('Error: ' . mysqli_error($con));
    //}
}
$udate = date_create();
$unix_date = date_timestamp_get($udate);
$sql="UPDATE $table SET updated='$unix_date' WHERE pid='$pid'";
mysqli_query($con,$sql);
//if (!mysqli_query($con,$sql)) {
//  die('Error: ' . mysqli_error($con));
//}
mysqli_close($con);
echo "<br>$date";
?>
<commit_msg>most GET to POST<commit_after><?php
include("connect.php");
include('tables.php');
$_POST = array_map('strip_tags', $_POST);
$_POST = array_map('htmlspecialchars', $_POST);
//date format and time zone
date_default_timezone_set('America/New_York');
$date = date('l jS \of F Y h:i:s A');
$pid=$_POST['pid'];
$result = mysqli_query($con,"SELECT * FROM $table WHERE pid='$pid' ");
if( mysqli_num_rows($result) > 0) {
    print "updating...";
}
else
{
    $sql="INSERT INTO $table (pid) VALUES ('$pid')";
    if (!mysqli_query($con,$sql)) {
      die('Error: ' . mysqli_error($con));
    }
}
foreach($_POST as $key => $value) {
    echo 'Current value in $_POST["' . $key . '"] is : ' . $value . '<br>';
    $entry = mysqli_real_escape_string($con, $value);
    //$sql="UPDATE WHERE pid='$pid' $table ($key) VALUES ('$entry')";
    $sql="UPDATE $table SET $key='$entry' WHERE pid='$pid'";
    mysqli_query($con,$sql);
    //if (!mysqli_query($con,$sql)) {
    //  die('Error: ' . mysqli_error($con));
    //}
}
$udate = date_create();
$unix_date = date_timestamp_get($udate);
$sql="UPDATE $table SET updated='$unix_date' WHERE pid='$pid'";
mysqli_query($con,$sql);
//if (!mysqli_query($con,$sql)) {
//  die('Error: ' . mysqli_error($con));
//}
mysqli_close($con);
echo "<br>$date";
?>

{'fraction_non_alphanumeric': 0.2341425215348473, 'fraction_numerical': 0.0007830853563038371, 'mean_word_length': 4.677777777777778, 'pattern_counts': {'":': 0, '<': 9, '<?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': '590705', 'n_tokens_mistral': 985, 'n_tokens_neox': 961, 'n_words': 199}