tags:

views:

75

answers:

2

I need a way to invoke a non-closable, iframe overlay where the user will have to choose their membership before being able to access any of the pages. I am doing a DB check for something, an if it returns false, then i want to invoke the overlay somehow without disrupting the session_start() function.

Any suggestions?

+1  A: 

This isn't really need a JavaScript issue. You just need to have your PHP output the necessary HTML and accompany it with the proper CSS.

<?php

session_start();
include('header.php');

if ( !checkMembership() ) {
?>

  <div id="overlay">
    <form>
    </form>
  </div>

<?php
}

include('footer.php');

?>
BBonifield
+1  A: 

I would try this approach:

Select rows from mysql that match your criteria and then count them

$criteria = false;
if (count($db_result) > 0) $criteria = true;

The in the view you could do something like this:

if ($criteria === false) {
    echo '<div id="overlay">Your stuff</div>';
}

Just insert overlay div after tag and use the following CSS style:

#overlay {
   position:fixed;
   top:0;
   right:0;
   bottom: 0;
   left: 0;
   z-index:9999;
   background-color: #FFF

}

Or use any transparent background image

Hope this helps

Mike