Answer the question
In order to leave comments, you need to log in
How to correctly read the value from cookies and assign a name to this value?
Good afternoon!
The cookie contains the city number. Written via Java.
Tell me, how to display the city in accordance with the number on the site through the snippet in php (modx)?
Created this design:
<?php
// выводим куку с именем "city"
if ( $_COOKIE['city'] != '1' )
echo 'Абакан';
if ( $_COOKIE['city'] != '2' )
echo 'Москва';
else
echo 'Привет, Гость!';
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question