<?php if(isset($_GET['id']) && $_GET['id']!='') { $id = $_GET['id']; if(isset($_SESSION['accordion_content'])) { if(isset($_SESSION['accordion_content'][$id])) { foreach ($_SESSION['accordion_content'][$id] as $value) { echo '<div class="menu_pod"><a href="http://'.$value['link_url'].'" style="color:white;" title="'.$value['link_title'].'">• '.$value['link_title'].'</a></div>'; } } else { $sql = mysql_connect('sql.shaaaadow.nazwa.pl','shaaaadow_3','MojeGniezno2009'); mysql_select_db('shaaaadow_3',$sql); $query = "SELECT * FROM accordion_links WHERE id_link='".$_GET['id']."';"; $result = mysql_query($query); while ($value = mysql_fetch_array($result)) { echo '<div class="menu_pod"><a href="http://'.$value['link_url'].'" style="color:white;" title="'.$value['link_title'].'">• '.$value['link_title'].'</a></div>'; $_SESSION['accordion_content'][$id][] = $value; } mysql_close($sql); } } else { $sql = mysql_connect('xxxxxx','shaaaadow_xxx','MojeGnieznoxxx'); mysql_select_db('shaaaadow_3',$sql); $query = "SELECT * FROM accordion_links WHERE id_link='".$_GET['id']."';"; $result = mysql_query($query); while ($value = mysql_fetch_array($result)) { echo '<div class="menu_pod"><a href="http://'.$value['link_url'].'" style="color:white;" title="'.$value['link_title'].'">• '.$value['link_title'].'</a></div>'; $_SESSION['accordion_content'][$id][] = $value; } mysql_close($sql); } }