Please help me with this error. I try to modify the php.ini file to add ;short_open_tag=off but nothing works?
<?php
function pdo_connect_mysql(){
//Connection DB
$DATABASE_HOST = 'localhost';
$DATABASE_USER = 'root';
$DATABASE_PASS = '';
$DATABASE_NAME = 'products';
//Try - Catch for exception with PDO
try {
return new PDO('mysql:host=' . $DATABASE_HOST . ';dbname=' . $DATABASE_NAME .
';charset=utf8',$DATABASE_USER,$DATABASE_PASS);
}catch (PDOException $e){
exit('Failed to connect to database!');
}
}
//Template
function template_header($title){
//Cantity of articles on cart
$num_items_in_cart = isset($_SESSION['cart'])?count($_SESSION['cart']):0;
echo <<<EOT
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>$title</title>
<link href="style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css">
</head>
<body>
<header>
<div class="content-wrapper">
<h1>Cos cumparaturi exemplu</h1>
<nav>
<a href="index.php">Home</a>
<a href="index.php?page=products">Produse</a>
</nav>
<div class="link-icons">
<a href="index.php?page=cart">
<i class="fas fa-shopping-cart"></i>
<span>$num_items_in_cart</span>
</a>
</div>
</div>
</header>
<main>
EOT;
}
// Template footer
function template_footer() {
$year = date('Y');
echo <<<EOT
</main>
<footer>
<div class="content-wrapper">
<p>© $year, cos cumparaturi exemplu didactic</p>
</div>
</footer>
</body>
</html>
EOT;
}
?>
What I have tried:
error is:
Parse error: syntax error, unexpected end of file on line 62
i changed many things and tried,but this error always exist. please,say,what does this error mean? and what actually error is ?