title: Removing the variables in url
body: <p>Before I am told to look at other posts that are similar, please note that I have tried to apply them but to no avail. </p>
  
  <p>I need to clear the variables in the url after a series of if statements are true. I have the following code: </p>
  
  <pre><code>&lt;?php
  
  
  $_SESSION['passlevel']='0'; 
  
  if ($_SESSION['passlevel'] == '0')
  
  {
  if(isset($_GET['box_1_color']))
  {
  $color=$_GET['box_1_color'];
      if($color == "#800080")
      {
      echo "you have passed step one.";
  
      $_SESSION['passlevel'] = '1';
  
      // add something that removes url string
  
  
  
      }
      else 
      {
      echo "you didn't select purple.";
  
      }   
  }
  else echo "login with your colorlock passcode.";
  
  }
  
  if ($_SESSION['passlevel'] == '1')
  
  {
  if(isset($_GET['box_1_color']))
  {
  $color=$_GET['box_1_color'];
      if($color == "#DD7500")
      {
      echo "you have passed step two.";
      $_SESSION['passlevel']='2'; 
              // add something that removes url string
  
      }
      else 
      {
      echo "you didn't select orange.";
  
      }   
  }
  else echo "enter remaining colors.";
  
  }
  
  
  ?&gt;
  </code></pre>
  
  <p>This is for color dependent password that has the background of each of 10 divs change to one of 10 colors after a div is clicked on (note that some of the echoes are only there for now as a method of debugging). The information is sent to the url through multiple forms:</p>
  
  <pre><code>&lt;form&gt; 
  &lt;div id="box1" class="box" onclick='this.parentNode.submit()'&gt;&lt;/div&gt;
  &lt;input type='hidden' name='box_1_color' value='&lt;?php echo $box1color ?&gt;'/&gt; 
  &lt;input type='hidden' name='name' value='box1color'/&gt; 
  &lt;/form&gt;
  
  &lt;form&gt;
  &lt;div id="box2" class="box" onclick='this.parentNode.submit()'&gt;&lt;/div&gt;
  &lt;input type='hidden' name='box_1_color' value='&lt;?php echo $box2color ?&gt;'/&gt;
  &lt;input type='hidden' name='name' value='box2color'/&gt; 
  &lt;/form&gt;
  
  &lt;form&gt;
  &lt;div id="box3" class="box" onclick='this.parentNode.submit()'&gt;&lt;/div&gt;
  &lt;input type='hidden' name='box_1_color' value='&lt;?php echo $box3color ?&gt;'/&gt; 
  &lt;input type='hidden' name='name' value='box3color'/&gt; 
  &lt;/form&gt;
  
  &lt;form&gt;
  &lt;div id="box4" class="box" onclick='this.parentNode.submit()'&gt;&lt;/div&gt;
  &lt;input type='hidden' name='box_1_color' value='&lt;?php echo $box4color ?&gt;'/&gt;  
  &lt;input type='hidden' name='name' value='box4color'/&gt; 
  &lt;/form&gt;
  
  &lt;form&gt;
  &lt;div id="box5" class="box" onclick='this.parentNode.submit()'&gt;&lt;/div&gt;
  &lt;input type='hidden' name='box_1_color' value='&lt;?php echo $box5color ?&gt;'/&gt;  
  &lt;input type='hidden' name='name' value='box5color'/&gt; 
  &lt;/form&gt;
  
  &lt;form&gt;
  &lt;div id="box6" class="box" onclick='this.parentNode.submit()'&gt;&lt;/div&gt;
  &lt;input type='hidden' name='box_1_color' value='&lt;?php echo $box6color ?&gt;'/&gt; 
  &lt;input type='hidden' name='name' value='box6color'/&gt; 
  &lt;/form&gt;
  
  &lt;form&gt;
  &lt;div id="box7" class="box" onclick='this.parentNode.submit()'&gt;&lt;/div&gt;
  &lt;input type='hidden' name='box_1_color' value='&lt;?php echo $box7color ?&gt;'/&gt; 
  &lt;input type='hidden' name='name' value='box7color'/&gt; 
  &lt;/form&gt;
  
  &lt;form&gt;
  &lt;div id="box8" class="box" onclick='this.parentNode.submit()'&gt;&lt;/div&gt;
  &lt;input type='hidden' name='box_1_color' value='&lt;?php echo $box8color ?&gt;'/&gt;
  &lt;input type='hidden' name='name' value='box8color'/&gt;
  &lt;/form&gt;
  
  &lt;form&gt;
  &lt;div id="box9" class="box" onclick='this.parentNode.submit()'&gt;&lt;/div&gt;
  &lt;input type='hidden' name='box_1_color' value='&lt;?php echo $box9color ?&gt;'/&gt;
  &lt;input type='hidden' name='name' value='box9color'/&gt;
  &lt;/form&gt;
  
  &lt;form&gt;
  &lt;div id="box10" class="box" onclick='this.parentNode.submit()'&gt;&lt;/div&gt;
  &lt;input type='hidden' name='box_1_color' value='&lt;?php echo $box10color ?&gt;'/&gt; 
  &lt;input type='hidden' name='name' value='box10color'/&gt; 
  &lt;/form&gt; 
  </code></pre>
  
  <p>An example of the url after one of the colors (purple) is selected:
          <code>http://localhost/colorlock/index.php?box_1_color=%23800080&amp;name=box9color</code></p>
  
  <p>So I want to remove the ?box_1_color=%23800080&amp;name=box9color part. How could i remove it where the code says "// add something that removes url string" so that when the next block of code is initiated it doesnt run immediately with the same color code in the url before a user can select their next color?</p>
  
  <p>I hope my question is clear (i understand that it a confusing) and i hope that it is answerable. Thank you.</p>