Header issue

I am using the same file in both my intranet and internet(public) server

echo "<li style='text-align: right; padding:5px;'>Logged In User: $name </li>";?>
<form action="" method="POST">
    <button style="background:red;"    name="option" value="HOME" >Notice </button>
    <button style="background:brown;"  name="option" value="HOME" >Sales Enquiry</button>
    <button style="background:orange;" name="option" value="COMP">Complaints</button>
    <button style="background:green;"  name="option" value="ATTE">Attendence</button>
    <button style="background:blue; "  name="option" value="LOGOUT">Logout</button>
</form>
</header>
<?php
$option=$_REQUEST['option'];
if($option==='HOME')   {header("Location:notice.php"); }
if($option==='COMP')   {header("Location:complaint.php"); }
if($option==='ATTE')   {header("Location:attendence.php"); }
if($option==='LOGOUT') {header("Location:logout.php");}
?>

The same code was working in both servers but since yesterday it continues to work on my intranet server but does not work on my public server.

You can see it at https://www.fdms.in/fdms/head.php

In fact no header link works on any of my files!

Your code is probably redirecting back to the starting page, giving the appearance of not working. What is the php code on the target page(s) doing?

You should NOT use a post method form for navigation. Post method forms are used when performing an action on the server, such as inserting, updating, deleting data, or sending an email, … You should be using href links for navigation. This will also let search engines index your site (they don’t submit forms.) Also, for html5, an empty action=’’ attribute is not valid. To cause a form to submit to the same page it is on, leave the entire action attribute out of the form tag. You should validate all your resulting web pages at validator.w3.org

Sponsor our Newsletter | Privacy Policy | Terms of Service