try running through the loop but in the loop wait for the response.
while(x > y){
build request
send request
get response
if response is "Success" or "SuccessWithWarning"
Log the data somewhere so you can see your success
if response is "Failure" or "FailureWithWarning"
Log the data somewhere else so you can see the failures
increment your counter variable
End Loop
This way you know if it worked or not because you have to get a response. You would need to add in some error checking to the code to make sure it doesn't give a PHP error. But that should work.