I have a script on my shared hosting. When i execute the script it checks if there are new members on the site. If so, the script headers to my windows server with two get parameters and a script there will execute and make a useracount for the new user. this works manualy and for 1 user just fine, however, i want to add cron to this so it runs every 15 minutes. this is’nt the problem when there is one user, but is the script has more then one user, it wont reach there becouse of the header. How can i fix this?
my code:
$array = $arr->invoices->invoice;
foreach($array as $key => $value) {
if(!order_is_active($value->id)) {
$username_win = strtolower($value->firstname) . rand(9,9999);
$password_win = ucfirst(maakpass(10, TRUE, TRUE));
if (add_user_to_db($value->id, $value->userid, $value->status, $username_win, $password_win)) {
header('location: http://ip/adduper/?username=' . htmlspecialchars($username_win) . '&password=' . htmlspecialchars($password_win));
} else {
echo 'order bestaat al';
}
}
}
You can store all of the users in an array and then send the
json encodedstring to your other server which will thenjson_decodeit to get back an array. It can then loop over the array and add each user.