title: How to get back to the previous page while click on back button on browser using PHP and MongoDB
body: <p>After redirecting to another page while user is trying to get back to the previous page is getting the below error message using PHP and MongoDB.</p>
  <p>Error:</p>
  <p><a href="https://i.stack.imgur.com/AMgfN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AMgfN.png" alt="enter image description here" /></a></p>
  <p>Here is my code:</p>
  <p>search-result.php:</p>
  <pre><code>&lt;h2 class=&quot;srhtmargin&quot;&gt;&lt;a href=&quot;companydetails.php?cid=&lt;?php echo $vsrc['_id']; ?&gt;&quot; style=&quot;color: #2c3e50; float:left;&quot;&gt;&lt;img src=&quot;admin/uploads/&lt;?php echo $vsrc['image2']; ?&gt;&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;companydetails.php?cid=&lt;?php echo $vsrc['_id']; ?&gt;&quot; style=&quot;color: #2c3e50&quot;&gt;&lt;?php echo $vsrc['cname']; ?&gt;&lt;/a&gt;&lt;/h2&gt;
  </code></pre>
  <p>When user is clicking on the above link its redirecting to the <code>companydetails.php</code> page. Then when user is clicking on back button of browser on that (<code>i.e-companydetails.php</code>) page,the <code>search-result.php</code> url is coming  but its throwing the above message and while user is again reloading the page its coming.</p>
  <p>about-us.php:</p>
  <pre><code>&lt;div class=&quot;col-md-6&quot;&gt;
          &lt;form class=&quot;headerform&quot; role=&quot;search&quot; name=&quot;search&quot; action=&quot;search-result.php&quot; enctype=&quot;multipart/form-data&quot; method=&quot;post&quot;&gt;
          &lt;div class=&quot;input-group&quot;&gt;
          &lt;input class=&quot;form-control itextindent&quot; value=&quot;&lt;?php echo $_REQUEST['qsearch']; ?&gt;&quot; placeholder=&quot;Review Title, Company Or Product Name&quot; name=&quot;qsearch&quot; id=&quot;qsearch&quot; type=&quot;text&quot;&gt;
          &lt;div class=&quot;input-group-btn&quot;&gt;
          &lt;button class=&quot;btn btn-default&quot; type=&quot;submit&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-search&quot;&gt;&lt;/i&gt; Search&lt;/button&gt;
          &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  <p>From the above page the user can get into the <code>search-result.php</code> page.</p>
  <p>Here I need while user will click on back button it will return to the previous page(<code>search-result.php</code>) and the page will reload.</p>