var request = new XMLHttpRequest(),
type = 'POST',
data = {u:"type=1s&mbet=47&kolvos=12&diams=300&visotas=300&diamss=400&visotass=20&shirinalenty=6&dlinalenty=8&visotalenty=70&tolshinalenty=40&dlinalenty2=4&dlinasterjna=11.7&sdoski=15&ddoski=600&tdoski="};
request.open(type, 'http://test.ru', true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
request.send(data);
foreach ($products as $tovar) {
$product_Url = 'http://happygifts.ru' . $tovar['url'];
parseCategory($product_Url)
}
function parseCategory($url){
...//тут парсим продукты страницы
if($next){
parseCategory($next);
}
}