Hie i need a littles help i have php code like below, when i try to use the header redirect php function it wont work as you can see below. The problem is with the last two lines of code
<?php
require_once __DIR__.'/../src/whatsprot.class.php';
$username = '11111111';
$password = '9lW8oEhIwuKtVPKouTffefee=';
$nickname = 'NUMBER';
$debug = true;
$w = new WhatsProt($username, $nickname, $debug);
$w->connect();
$w->loginWithPassword($password);
?>
<?php
$con=mysqli_connect("localhost", "user", "pass", "db");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="SELECT number FROM testnumbers";
$result=mysqli_query($con,$sql);
// Associative array
while( $row=mysqli_fetch_array($result,MYSQLI_ASSOC))
{
$storeArray[] = $row['number'];
};
$arrlength = count($storeArray);
for($x = 0; $x <= $arrlength; $x++) {
//send picture
$w->sendMessageImage($storeArray[$x], 'demo/filepage1.jpg');
$w->pollMessage();
}
header('location: index.php'); //not working
exit(); //not working