Answer the question
In order to leave comments, you need to log in
Need help with recording session on link click in Zend Framework 1.12.17, how?
There is a database of MySQL cities and two .phtml pages, layout.phtml and index.phtml , I displayed the cities on the city selection page - index.phtml :
<?php
foreach($this->contentRows as $city){
if(!empty($city->link)){
$link = $city->id_record .'-'.$city->link;
}
else{
$link = $city->id_record;
};
?>
<a href='/?city'><?=$city->title;?></a><br>
<?
};
?>
<?php
session_start();
ini_set('session.gc_maxlifetime', 3600*24*30);
ini_set('session.cookie_lifetime', 3600*24*30);
if(!$_SESSION['locality'])
{
if (isset($_GET['city'])){$_SESSION['locality'] = ...;}
elseif (isset($_GET['city'])){$_SESSION['locality'] = ...;}
Answer the question
In order to leave comments, you need to log in
The easiest way is to add one more parameter to the link
And than
if (! empty($_GET['title'])) {
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question