Jump to content

Activate shadowbox using PHP vairables


HCProfessionals

Recommended Posts

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>
   ';
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.