title: Is it possible to output certain content on a php document and make it die only if it’s URL is present with a value of true on a MySQL database?
body: <p>I am trying to setup a PHP document but I currently am looking for a way to use the <code>die()</code> function and display some content on every page using my global configuration file. The way I am think how it should work is that IF the requested URL (e.g. domain.com/services/disabledservice) would have <code>/services/disabled service</code> and a value of <code>1</code> to make the value true in a MYSQL DB.</p>
  
  <p>The plan is to have the URL be collected and checked with a table than if the row has a value of 1 for status it will display a disabled page message but if it’s 0 it will load normally.</p>
  
  <p>Some research I have conducted may lead be to think that using the SQL query and the if function could work for this.</p>
  
  <p>The idea I have is this but it may not be correct.</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php $pageurl = [requested URL content here]
  $checkstatus = "SELECT * FROM servicestatus WHERE page =" . $pageurl . "AND status = 1";
  if ($status = mysqli_query($conn, $servicestatus)) {
      if (mysqli_num_rows($status) = 1) { ?&gt; html content here
      &lt;?php }
  } else { ?&gt;
      page as normal
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>Edit:</p>
  
  <p>To explain what I am trying to do.. I am trying to fetch the URL without everything past “?” Than I am trying to use that in a DB query to check with the database if that has a value of “m” or “d” and if it has one of those values next to the URL which is being fetched it will display the appropriate error page. This is being included as part of my core configuration file which includes my “$conn” and the core values for most stuff. The problem I am facing is that when I send my URL without everything past the “?” I am not receiving my error page and everything is loading like normal.</p>