header('Location: http://server_name/sorry_test.php');

 using header

HTML Client

<html>
<body>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="211">
<tr> <td width="209">&nbsp;</td> </tr>
<tr> <td width="209"><form method="POST" action="test_header_1.php">
<input type="text" name="T1" size="20"><br>
<input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form> <p>&nbsp;</td>
</tr> <tr>
<td width="209">&nbsp;</td>
</tr></table>
</body>
</html>

code test_header_1.php

<?php
$test=$_POST['T1'];
if($test=="Manas"){
echo "You're in!";
}
else{
header('Location: http://manas8x/php5/test_header/sorry_test.php');
}
?>

code sorry.php

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Sorry Register first</title>
</head>

<body text="#000080" bgcolor="#C0C0C0">
<?php echo "Before you visit you must register <br>" ;
echo"<a href='http://frontierosoft.net'> Frontiersoft </a>";
?>
</body>

</html>

Run time demo: (  intranet uses only) Type Manas

any mistake