Hi,
Thanks for sharing your requirement here at Freelancer, I will be more than happy to help you.
I understand that you have some issues with your script that are using cURL to post data to login and then send message to the user but it's good to discuss more on this and allow me to fix this.
I would like to mention that I will take payment only after completion of this job, I will first finish this job and then ask you to award and pay at the same time to maintain trust.
Regards,
Kapil