title: Loading page info into array, and cycling page info as URLs
body: <p>I;ve built a CMS that allows users to build static pages of images and text content solely for displaying on television screens throughout our building. I've completed this to the point of viewing the display with it's pages but only if I call it explicitly in the url. The problem is, I want to load by display which is stored in the URL. </p>
  
  <p>For instance, the url now if you click on Display 3 is <code>http://local.CMSTest.com/showDisplay.php?display=3</code></p>
  
  <p>and this calls a function using 3 as the display ID that grabs all pages with that display ID. This works, but in my html where I throw a <code>foreach</code> in there, it loads both pages associated with that display into a crammed page, half and half. So I know it's working but I need to store these pages into an array for javascript as well I believe.</p>
  
  <p>I'm thinking there may be a way where I can load it with the first page on default and append it to the url like <code>http://local.CMSTest.com/showDisplay.php?display=3&amp;page_id = 2</code> and then after the time is up, it can go to the next one and change the URL <code>http://local.CMSTest.com/showDisplay.php?display=3&amp;page_id = 3</code></p>
  
  <p>So the PHP and HTML is working at this moment:</p>
  
  
      
  
  <pre><code>    &lt;div class="row top"&gt;
          &lt;?php include 'banner.php'?&gt;
      &lt;/div&gt;
  
      &lt;div class="row middle" style="background-image: url(&lt;?php echo $showDisplays['background_img']?&gt;);"&gt;
          &lt;div class="col-lg-12"&gt;
              &lt;?if($showDisplays['panel_type_id'] == 1){?&gt;
              &lt;div class="fullContent" style=" height: 100%; "&gt;
              &lt;?php echo $showDisplays['content']?&gt;
              &lt;/div&gt;
              &lt;?}?&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="row bottom"&gt;
          &lt;?php include 'ticker.php';?&gt;
      &lt;/div&gt;
  
  &lt;?php }?&gt; 
  </code></pre>
  
  
  
  <p>I want to try some javascript like this that will take each page from the array, replacing the following URLs with page IDs from my previous array. How can I do this properly?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var Dash = {
  nextIndex: 0,
  
  dashboards: [
      {url: "http://www.google.com", time: 5},
      {url: "http://www.yahoo.com", time: 10},
      {url: "http://www.stackoverflow.com", time: 15}
  ],
  
  display: function()
  {
      var dashboard = Dash.dashboards[Dash.nextIndex];
      frames["displayArea"].location.href = dashboard.url;
      Dash.nextIndex = (Dash.nextIndex + 1) % Dash.dashboards.length;
      setTimeout(Dash.display, dashboard.time * 1000);
  }
  };
  
  window.onload = Dash.display;
  &lt;/script&gt;
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>Current array</p>
  
  <pre><code>Array ( [pageID] =&gt; 104 [page_type_id] =&gt; 1 [display_id] =&gt; 3 [slide_order] =&gt; [active] =&gt; 1 [background_img] =&gt; [panel_id] =&gt; 96 [panel_type_id] =&gt; 1 [page_id] =&gt; 104 [cont_id] =&gt; 148 [contID] =&gt; 148 [content] =&gt;This is full content)
  </code></pre>