HCProfessionals Posted March 7, 2011 Share Posted March 7, 2011 Is it possible to activate shadowbox http://www.shadowbox-js.com (similar to lightbox) if php value = 1? Quote Link to comment https://forums.phpfreaks.com/topic/229845-activate-shadowbox-using-php-vairables/ Share on other sites More sharing options...
HuggieBear Posted March 7, 2011 Share Posted March 7, 2011 Yes, from the look of the shadowbox-js website, the following code is used to include shadowbox on the page: <link rel="stylesheet" type="text/css" href="shadowbox.css"> <script type="text/javascript" src="shadowbox.js"></script> <script type="text/javascript"> Shadowbox.init(); </script> The following should work: <?php // This is the value that you can switch between 1 and 0 $show = 1; if ($show){ echo ' <link rel="stylesheet" type="text/css" href="shadowbox.css"> <script type="text/javascript" src="shadowbox.js"></script> <script type="text/javascript"> Shadowbox.init(); </script> '; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/229845-activate-shadowbox-using-php-vairables/#findComment-1184100 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.