How to auto post php form imported data



1.txt
 aaaaaaaaaa
 bbbbbbbbbb
 cccccccccc
 ......

Code:


`$post_data = array( 'user_data' => array(
'username' => $username,
'password' => $password,
'max_connections' => $max_connections,
'is_restreamer' => $restreamer,
'member_id' => $reseller,
'created_by' => $reseller,
'is_trial' => $is_trial,
'exp_date' => $expire_date,
'bouquet' => json_encode( $bouquet_ids ) ) );

$opts = array( 'http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query( $post_data ) ) );

$context = stream_context_create( $opts );
$api_result = json_decode( file_get_contents( $panel_url . "api.php?action=user&sub=create", false, $context ) );
// $obj = $api_result;
// $name = $obj->{'username'};
// $pass = $obj->{'password'};
print_r($api_result);
// print_r($post_data);    
?>

</div>
<div class="content">
<?php
$path = "1.txt";
$file = fopen($path, 'r');
$data = fread($file, filesize($path));
fclose($file);

$lines =  explode(PHP_EOL,$data);
foreach($lines as $line) {
  echo '<form id="submit" action="#add1.php" method="post" >

<div class="form-group">
<div style="width:100%; background:#eeeeee;">
<button type="multiselect" id="submit" class="btn btn-primary" name="submit">ENTER</button>
<input type="hidden" name="macadress" id="macadress" value= '. $line.'>'.$line.'';

  echo '</form>';
}
?>
</div>
<script>
window.onscroll = function() {myFunction()}; // sleep(1);
var header = document.getElementById("myHeader");
var sticky = header.offsetTop;

function myFunction() {
  if (window.pageYOffset > sticky) {
    header.classList.add("sticky");
  } else {
    header.classList.remove("sticky");
  }
}

</script>

Hello all.

I use below code and many data listed when run php. (1000-1500 pcs) need to click one by one for submit lines.

imported data from txt (1.txt) file and listed line by line. all lines have submit button and send by click submit button. How to auto post created lines with 1 second delay.