title: Pop up window automatically on page load
body: <p>I'm trying to allow a pop up to display always when a user is basically unregistered and wishes to view the certain page. I saw an example of how to do it but I am completely stuck it's not appearing on my page. Any ideas?</p>
  
  <p>Thanks!</p>
  
  <p>Image: <a href="http://puu.sh/cr1Zz/1b5da28635.png" rel="nofollow">http://puu.sh/cr1Zz/1b5da28635.png</a></p>
  
  <p>My code  on that page(CSS is listed in the image above)</p>
  
  <pre><code>&lt;?php
   session_start();
  include ('../includes/config.php'); 
  include ('../includes/header.php'); 
  ?&gt;
  
  &lt;!DOCTYPE HTML&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Honda | &lt;/title&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"&gt;
  &lt;link href='http://fonts.googleapis.com/css?family=Julius+Sans+One' rel='stylesheet' type='text/css'&gt;
  &lt;link href="../css/style.css" rel="stylesheet" type="text/css" media="all" /&gt;
  
  &lt;!--start lightbox --&gt;
  &lt;link rel="stylesheet" type="text/css" href="../css/jquery.lightbox.css"&gt;
  &lt;script src="../js/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="../js/jquery.lightbox.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    // Initiate Lightbox
    $(function() {
      $('.gallery1 a').lightbox(); 
    });
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class='modalDialog'&gt;You cannot view this page! Please register&lt;/div&gt;
  
  &lt;!--start header--&gt;
  &lt;div class="h_bg"&gt;
  &lt;div class="wrap"&gt;
  &lt;div class="wrapper"&gt;
  &lt;div class="header"&gt;
      &lt;div class="logo"&gt;
           &lt;a href="index.php"&gt;&lt;img src="../images/logo.png"&gt; &lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="cssmenu"&gt;
      &lt;ul&gt;
         &lt;li&gt;&lt;a href="index.php"&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="about.php"&gt;&lt;span&gt;About&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
         &lt;li class="active" class="has-sub"&gt;&lt;a href="service.php"&gt;&lt;span&gt;Gallery&lt;/span&gt;&lt;/a&gt;
         &lt;/li&gt;
         &lt;li class="last"&gt;&lt;a href="contact.php"&gt;&lt;span&gt;Contact&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
       &lt;div class="clear"&gt;&lt;/div&gt;
  
                           &lt;div class="search"&gt;
                      &lt;h2&gt;search&lt;/h2&gt;
              &lt;form&gt;
                  &lt;input type="text" value="" placeholder="Enter Your search..."&gt;
                  &lt;input type="submit" value=""&gt;
              &lt;/form&gt;
          &lt;/div&gt;
       &lt;?php
  if(isset($_POST["submit"])){
  
  if(!empty($_POST['user']) &amp;&amp; !empty($_POST['pass'])) {
      $user=$_POST['user'];
      $pass=$_POST['pass'];
  
      $pass = strip_tags($pass); 
  $pass = md5($pass); // md5 is used to encrypt your password to make it more secure.
  
  
  
      $query=mysql_query("SELECT * FROM login WHERE username='".$user."' AND password='".$pass."'");
      $numrows=mysql_num_rows($query);
      if($numrows!=0)
      {
      while($row=mysql_fetch_assoc($query))
      {
      $dbusername=$row['username'];
      $dbpassword=$row['password'];
      }
  
      if($user == $dbusername &amp;&amp; $pass == $dbpassword)
      {
      session_start();
      $_SESSION['sess_user']=$user;
  
      /* Redirect browser */
      header("Location: member.php");
      }
      } else {
      echo "&lt;div class='results'&gt;Invalid username or password!&lt;/div&gt;";
      }
  
  } else {
      echo "All fields are required!";
  }
  }
  ?&gt;
  
                   &lt;div class="search1"&gt;
  
              &lt;h2&gt;login/Register&lt;/h2&gt;
  
  
              &lt;form action="" method="POST"&gt;
  
              &lt;label&gt;Username:&lt;/label&gt;
                  &lt;input type="text" name="user" required /&gt;
              &lt;label&gt;Password:&lt;/label&gt;
                  &lt;input type="password" name="pass" required /&gt;
                  &lt;input type="submit" value="Login" name="submit" class="submit" /&gt;
                  &lt;br&gt;&lt;br&gt;
                  &lt;center&gt;
                  &lt;h2&gt;&lt;p&gt;&lt;a href="register.php"&gt;Register&lt;/a&gt;&lt;/p&gt;&lt;/h2&gt;
                  &lt;/center&gt;
      &lt;/form&gt; 
      &lt;/div&gt;
  
      &lt;/div&gt;
       &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- start content --&gt;
  &lt;div class="footer_bg"&gt;
  &lt;div class="wrap"&gt;
  &lt;div class="wrapper"&gt;
      &lt;div class="footer2"&gt;
          &lt;div class="copy"&gt;
              &lt;p class="w3-link"&gt;©&amp;nbsp;&lt;/p&gt;
          &lt;/div&gt;
          &lt;div class="f_nav"&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="#"&gt;Skype&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Linked in&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Facebook&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
          &lt;/div&gt;
          &lt;div class="clear"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>