Skip to content

Instantly share code, notes, and snippets.

@ityulkanov
Created February 3, 2017 20:27
Show Gist options
  • Save ityulkanov/5a62418cedf3354acf56e9f070be8b4f to your computer and use it in GitHub Desktop.
Save ityulkanov/5a62418cedf3354acf56e9f070be8b4f to your computer and use it in GitHub Desktop.
<?php
if( !session_id() )
{
session_start();
}
include("db.php");
if (isset($_POST['phone_bl'])) {
$phone_black_listed = $_POST['phone_bl'];
$description = $_POST['comment'];
$date = date("Y-m-d");
// $description = utf8_encode($description);
$query = "INSERT INTO records(phone, description, date_added) VALUES ('$phone_black_listed ', '$description ', '$date ')";
$query_new_phone = mysqli_query($connection, $query);
if (!$query_new_phone) {
die("query failed");
}
$_SESSION["msg"]='Добавлена запись в черный список';
header("Location: index.php");
exit();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment