window.open is not working. could you help me solve the problem. i have a table that contains data. id if click on one of it it will redirect to a page where the system counts how many times it have been opened and then it will open a new tab with a specific url. but it is not working . heres my code; please help me. i did not include the $brochure_id and $type in my code below cause i already use it in my code above it would be very long if i include it.
$sql1 = "SELECT * from business_type WHERE business_id = '$type'";
$q1= $conn->query($sql1);
$q1->setFetchMode (PDO::FETCH_ASSOC);
while($r1 = $q1->fetch())
{
if($r1['business_type'] == "Hotel"){
window.open('search-result-page-hotel.php?id='. $brochure_id . '','_newtab');
}
else if($r1['business_type'] == "Restaurant"){
window.open('search-result-page-restaurant.php?id='. $brochure_id . '','_newtab');
}
else if($r1['business_type'] == "Resort"){
window.open('search-result-page-resort.php?id='. $brochure_id . '','_newtab');
}
else if($r1['business_type'] == "Spa"){
header('Location: search-result-page-spa.php?id='. $brochure_id);
}
else if($r1['business_type'] == "Entertainment"){
window.open('search-result-page-spa.php?id='. $brochure_id . '','_newtab');
}
}