Note that there are some explanatory texts on larger screens.

plurals
  1. POunable to set http_referer
    text
    copied!<p>How can I set my <code>http_referer</code> location in my <code>logout.php</code> page after signin(using signin.php) which checks &amp; successfully login redirects to joomla.php where i gave logout link(using a href) now i want to click on logout &amp; go to `signin. php &amp; i got http_referer is joomla.php so hw can i set logout.php</p> <ol> <li><p><strong>Code: Signin.php</strong></p> <pre><code>$referer = $_SERVER['HTTP_REFERER']; echo $referer; if ($referer == 'http://localhost/MinProject/reg.php') { echo "Registration SuccessFully"; } else if($referer=='http://localhost/MinProject/changepassword.php') { echo"Change Password SuccessFully"; } </code></pre></li> <li><p><strong>joomla.php</strong></p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;table width="100%"&gt; &lt;tr&gt; &lt;td width="20%" height="32" align="right" class="unm"&gt; &lt;?php session_start(); if(isset($_SESSION['username'])) { $name =$_SESSION['username']; echo "Welcome ".$name; } ?&gt; &lt;/td&gt; &lt;td width="64%" height="32" align="right"&gt; &lt;a href="changepassword.php"&gt;ChangePassword&lt;/a&gt; &lt;/td&gt; &lt;td width="10%" align="right"&gt; &lt;a href="logout.php"&gt;logout&lt;/style&gt;&lt;/a&gt; &lt;/td&gt; &lt;td width="11%"&gt;&lt;/td&gt; &lt;td width="5%"&gt;&lt;/td&gt; &lt;td width="5%"&gt;&lt;/td&gt; &lt;td width="5%"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre></li> <li><p><strong>logout.php</strong></p> <pre><code>session_start(); unset($_SESSION['username']); session_destroy(); response.setHeader("Location: http://localhost/MinProject/logout.php"); header("Location: Signin.php"); exit(); </code></pre></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload