#1
  1. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,998
    Rep Power
    375

    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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,505
    Rep Power
    594
    Anything is possible.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    397
    Rep Power
    189
    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...
    Thomas Tremain
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,998
    Rep Power
    375
    Originally Posted by ttremain
    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...
    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...
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    397
    Rep Power
    189
    Originally Posted by paulh1983
    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...
    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.
    Last edited by ttremain; April 26th, 2013 at 10:23 AM.
    Thomas Tremain

IMN logo majestic logo threadwatch logo seochat tools logo