I've used 301 in this example. but this can also be 302. The difference is that a 301 redirect means that the page has moved to a new location, permanently. A 302 redirect means that the move is temporary.
first page(x) redirect me to second page(y) and when i do some action from second page and my third page i called actions.php and that action i did from page y it go to actions.php. From action php should automatocally redirct to my second page (y).
page x o first page is like this ...
$item_query=mysql_query("SELECT * FROM items ") or die(mysql_error());
echo "<a href='product.php?product=$userid'>$username</a>";