title: Wordpress - How refresh page after updating a DB
body: <p>I’m trying to make a plugin to a slider
  I already made an admin panel, and I can update the db,
  but I've a problem after I put the new data and press update - its updates the db, but it is not shown on the page.
  I need to refresh the admin page, and only after that, I can see the changes.</p>
  <p>How can I automatically refresh the page?</p>
  <ul>
  <li>I try to call js func etc.:window.location.reload()</li>
  <li>I tried a lot but nothing seemed work</li>
  <li>I have a little understanding of JavaScript and I don't know what the problem is and how to fix it</li>
  </ul>
  <p>Code:</p>
  <pre><code>&lt;form  action=&quot;&quot; method=&quot;post&quot;&gt;
  &lt;?php
  for($i=1; $i&lt;=5; $i++)
  {
      $sliderows=getSliderData($i);
      echo '&lt;div id=&quot;single-slide-wrap&quot;&gt;
              &lt;div id=&quot;slide-num&quot;&gt;
                  &lt;p id=&quot;stitle&quot;&gt;&lt;strong&gt;#'.$i.'&lt;/strong&gt;&lt;/p&gt;
                  &lt;input name=&quot;slideradio&quot; type=&quot;radio&quot; value=&quot;'.$i.'&quot; /&gt;
              &lt;/div&gt;&lt;!--slide-num--&gt;
              &lt;div id=&quot;slide-pic&quot;&gt;
                  &lt;img alt=&quot;&quot; src=&quot;'.$sliderows['img'].'&quot; style=&quot;width: 120px; height: 80px;&quot; /&gt;
              &lt;/div&gt;&lt;!--slide-pic--&gt;
              &lt;div id=&quot;slide-text&quot;&gt;
                  &lt;strong&gt;Img Url: &lt;/strong&gt;'.$sliderows['img'].'&lt;br /&gt;
                  &lt;strong&gt;Title: &lt;/strong&gt;'.$sliderows['title'].'&lt;br /&gt;
                  &lt;strong&gt;Url: &lt;/strong&gt;'.$sliderows['url'].'&lt;br /&gt;
              &lt;/div&gt;&lt;!--slide-text--&gt;
                  
              &lt;/div&gt;&lt;!--single-slide-wrap--&gt;';
  }
      ?&gt;
      
  &lt;h3&gt;update Slider&lt;/h3&gt;
  
  IMAGE URL: &lt;input type=&quot;text&quot; name=&quot;img&quot; /&gt;
  TEXT: &lt;input type=&quot;text&quot; name=&quot;text&quot; /&gt;
  URL: &lt;input type=&quot;text&quot; name=&quot;url&quot; /&gt;
  &lt;input type='submit' name=&quot;submit&quot; value='update'  /&gt; 
  &lt;/form&gt;
  
  &lt;?php       
  
    if (isset($_POST['submit'])) {
      if (isset($_POST['slideradio'])) {
  
        switch ($_POST['slideradio']) {
          case '1':
            update_slider_db(1);
            break;
          case '2':
            update_slider_db(2);
            break;
          case '3':
            update_slider_db(3);
            break;
          case '4':
            update_slider_db(4);
            break;
          case '5':
            update_slider_db(5);
            break;
        }
      }
    }
  
    echo '&lt;/div&gt;';
  }
  </code></pre>