Page Redirect in Zen cart (PHP)
===

I have page in zen cart like

    http://localhost/zencarttest/test/t-shirts

it is display list of t-shirts and on click of t-shirt my page redirect on 

    http://localhost/zencarttest/test/t-shirts/red-t-shirt

and it is display details of the t-shirt and then i want to add it shopping cart and the url is

    http://localhost/zencarttest/test/index.php?main_page=shopping_cart&number_of_uploads=0

then after i am again purchase another t-shirt and url is the

    http://localhost/zencarttest/test/t-shirts/black-t-shirt


and it is display details of the t-shirt and then i want to add it shopping cart and the url is

    http://localhost/zencarttest/test/index.php?main_page=shopping_cart&number_of_uploads=0

in my shopping cart now i have a two t-shirt.

Now i am delete the one t-shirt and my url is the

    http://localhost/zencarttest/test/index.php?main_page=shopping_cart&product_id=188%3A123285a3e52a156e98cf8e1d171ade06

now i have one button like to "Back to Shopping" and if i am press it then it will redirect on the 


    http://localhost/zencarttest/test/t-shirts/black-t-shirt

means i want to redirect my page on the product detail page which i am visited last time


i am try the

    <?php $_SERVER['HTTP_REFERER'];?>

but after delete it will return this url 


    http://localhost/zencarttest/test/index.php?main_page=shopping_cart&product_id=188%3A123285a3e52a156e98cf8e1d171ade06

but my requirement is the 

    http://localhost/zencarttest/test/t-shirts/black-t-shirt


So friend how it is possible to get above url.

Any idea or suggestion

Thanks in advance .