I want code to go back to previous page plus where I was. I am using code written below to go back to previous page but it doesn't go back to the part of page where the focus was previously.
echo "<meta http-equiv=\"refresh\" content=\"0;url=".$_SERVER['HTTP_REFERER']."\"/>";
Using the meta refresh method launches a new request. If you trigger the browser's "back" button with javascript, it should return to the previous page while keeping the "location" where you were:
<script type="text/javascript">
history.back();
// Or alternatively..
history.go(-1);
</script>