Hello,
I'm trying to put this PopUp to be managed from one dashboard.
Have already created the panel, connected with MySQL and is working properly, my problem is I do not know how to get the PopUp only open when the the item ACTIVE = 1.
I let down the structure of the database.
Code:
CREATE TABLE IF NOT EXISTS `popup` (
`id` int(10) unsigned NOT NULL auto_increment,
`titulo` varchar(150) default NULL,
`foto` varchar(150) default NULL,
`texto` text,
`active` tinyint(1) NOT NULL default '1',
`id_session` varchar(8) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
INSERT INTO `popup` (`id`, `titulo`, `foto`, `texto`, `active`, `id_session`) VALUES
(1, 'Important', '798391b8f9c6.jpg', 'text here...', '1', '1');
I tried to do this so that the PopUp only appears if ACTIVE = 1
Code:
<?php
$sql = mysql_query("SELECT * FROM popup");
$linha = mysql_fetch_array($sql);
$popupindex = '<div id="boxes">
<div style="top: 199.5px; left: 551.5px; display: none;" id="dialog" class="window">
<a href="#" class="close"><font color="#FF0000">Clique aqui para <b>FECHAR</b> esta janela e continuar navegando em nosso site!</font></a><font color="#FF0000">
</font></b>
<? echo nl2br($texto); ?>
</div>
<!-- Mask to cover the whole screen -->
<div style="width: 1478px; height: 602px; display: none; opacity: 0.8;" id="mask"></div>
</div>
';
$active = "1";
if($active == "1")
{
echo("$popupindex");
}
else
{
echo("");
}
?>
Please help me, because with the above code to PopUp is always shown, even as ACTIVE = 2 which is the value that I put to be inactive.
Bookmarks