U
U
Uzair Izha2015-11-30 18:44:36
PHP
Uzair Izha, 2015-11-30 18:44:36

How to open multiple pages in a loop using header()?

I have that but it doesn't work.

for ($i = 0; $i < $count_market; $i++) {



  $arrReq = array();
  
  $arrReq['pg_testing_mode']=1;
  $arrReq['cart_info']=$_POST['cart_info'];
  $arrReq['pg_merchant_id'] = $MERCHANT_ID;
  $arrReq['pg_order_id']    = $IDMARKET;		
  $arrReq['pg_amount']      = $SUMMA;		

    $arrReq['pg_payment_system'] = 'TEST';
       $ag[] =  array_values($arrReq);
  $query.$i = http_build_query($ag[$i]);



   header("Location: https://www.pl.ru/ment.php?$query.$i");



}

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Ukolov, 2015-11-30
@alexey-m-ukolov

No way, there can be only one Location in the answer. Rather, there can be many of them, but only one is used - the rest are ignored by the browser.
You can try to do this in js using window.open, but the browser will quickly stop this business.

E
Eugene, 2015-11-30
@Nc_Soft

Show n frames

A
Alexander N++, 2015-11-30
@sanchezzzhak

print some JS code on the page like this

<script>window.open(url1,'_blank');
window.open(url2,'_blank');
window.open(url2,'_blank');</script>

But the browser can block a large number of tab openings from the user through JS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question