April 26th, 2013, 06:23 AM
Posting to two different system on one page - slight problem?
Ok, I have created a landing page where users go and fill in their name etc.
when i process that information, i send it to my system (database) and directly underneath send it to my client's system through API.
My colleague has just said that some leads have gone to our system but NOT their system..
I have tested this 3 times consecutively & outputted the response from their API and each time it has been successful.
Q: is there any way possible that PHP would stop after the first call? assumingly if the first section generated an ERROR then lead wouldn't go to my system either?
The only way possible is if their browser timed out or maybe they pressed esc to abort the script midway? which I think is unlikely as the execution time is < 5 sec
April 26th, 2013, 08:00 AM
There are 10 kinds of people in the world. Those that understand binary and those that don't.
April 26th, 2013, 08:16 AM
You might consider just logging the data as the user submits the form, then process the API submission later in the background (cron job) while the user is off doing something else.
This will give you the opportunity to do additional error checking, and if the API system is unavailable, you can just try again 30 minutes later...
April 26th, 2013, 10:25 AM
That is a good idea, why didnt I think of that. thanks . The only problem is I don't want to store the data because of security risks. Like it will be an extra headache to worry about potential people trying to get the data. My system is pretty good, i didnt develop it but when the data gets stored in here, if anything goes wrong i.e. security risks, it wont be my fault...
Originally Posted by ttremain
April 26th, 2013, 10:42 AM
Depends on what it is, just queue it just long enough to get it to the remote server. Then you may have maybe one or two at a time. If you get more than a few in the queue, or any single item is queued longer than say 15 or 30 minutes, you could send yourself an email saying there may be trouble.
Originally Posted by paulh1983
Last edited by ttremain; April 26th, 2013 at 11:23 AM.