I just trying to get a value from the row, but it's not happening and I only get a notice which says:
Notice: Undefined index: sm_value in D:\xampp\htdocs_header.php on line 16
<?php
require "./conf/db.php"; // Additional data
session_start();
if (isset($_SESSION["UserID"])) {
}
else {
header('Location: login.php?=redirect');
}
// If user click to logout
if (isset($_GET["account"]) && $_GET['account'] == "logout") {
unset($_SESSION["UserID"]);
session_destroy();
header("Location: index.php"); // Redirect him/her to index.php
exit();
}
$name = mysqli_escape_string($mysqli, $_POST['sm_value']);
$GetTitle = $mysqli->query("select * from sm_options where sm_value='$name'");
$row = $GetTitle->fetch_array(MYSQLI_ASSOC);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?php echo $row['sm_name'];?></title>
....
Maybe something is wrong with the syntax? Or the method? How do I get the value?
The database looks like this:
I appreciate any kind of help :)