Hello. If you open a website, the first thing you do is execute a code that writes a specific value in a cookie:
setcookie('param', '1', time() + 60 * 60 * 24 * 7, "/"); And on the same page, I display the recorded value:
echo $_COOKIE['param']; And if you go to this page for the first time, you get a notification:
Notice: Undefined index: param
After updating the page, everything works as it should. This is due to the fact that in cookies, when you first start the page there is no param parameter.
how can this be solved?
if (isset($_COOKIE['param'])) { // do smth }- Alexey Shimanskyissetsomewhere lost. We need through him - Alexey Shimansky