Internal Links in PHP

Hi, while ritting the code i hav xperienced a problem with intenal link. my aim was to make the next and the previous button in order to nevigate respectively, the code is writtin below

 
ehco "<a name=flag></a>";
-----------------------------------
-----------------------------------
-----------------------------------
echo "<a href=\"".$_SERVER'PHP_SELF']."?page=".$prev."#flag\"><b>Previous</b></a>"; 
 

the code is worlking well and after anchoring the link the next page is displayed from flag… but the title of the page which was “PHP WEB” and which was suposed to remain same is now become “PHP WEB flag#flag”…
how can i amend this title…
one more thing, the entire contents (tags) of html are displyed through echo…

Re: Internal Links in PHP

echo "<title>"; 
echo "PHP Web"; 
echo "</title><link rel='stylesheet' type='text/css' href='corpstyle.css' />"; 
echo "</head>"; 
------------------------------------------ 
------------------------------------------ 
echo "<form method='POST' action=".$_SERVER'PHP_SELF']."#flag>"; 
------------------------------------------- 
------------------------------------------- 
ehco "Results<a name=flag></a>"; 
------------------------------------------- 
------------------------------------------- 
echo "<a href='".$_SERVER'PHP_SELF']."?page=".$next."#flag'><b>Next</b></a> | "; 
echo "<a href='".$_SERVER'PHP_SELF']."?page=".$prev."#flag'><b>Previous</b></a> ";

firstly when i press submit button the title bocomes “PHP WEB#flag#flag” and afterwards navigating through next and previous buttons, the title remains the same …“PHP WEB#flag#flag” (again 2 times flag occurs!), while in adres bar the adres of web is as expected… http://../phpwep.php#flag and http://../phpweb.php?page=2#flag respectively (submit button and then next button)…