Using the curl function is slowing my app down
Posted: Wed May 06, 2009 12:01 am
Hi,
I have a php phone app (click to call sort of thing) I'm writing that sends data filled in via a form and sends it to another server which places the phone call. The phone server api suggests to use the curl function to send the url with the data appended in the query string. That's fine and all, but when I use curl to send that url, my submission page hangs until the call connects. So in other words, here is the process:
1. Form page -> 2. Page where I do validation and initiate the curl -> 3. Success page shown to person who filled the form
To get around the problem I encountered with waiting for the call to connect, I created a new page with the curl function. Then in step 2, I use the fsockopen to process that new page. Now the form user gets right to the submission page quickly since the curl process is carried out in the background.
So my question? Is this the right way to be doing things? Is there a better way and maybe better yet, is this secure?
Thanks!
b
I have a php phone app (click to call sort of thing) I'm writing that sends data filled in via a form and sends it to another server which places the phone call. The phone server api suggests to use the curl function to send the url with the data appended in the query string. That's fine and all, but when I use curl to send that url, my submission page hangs until the call connects. So in other words, here is the process:
1. Form page -> 2. Page where I do validation and initiate the curl -> 3. Success page shown to person who filled the form
To get around the problem I encountered with waiting for the call to connect, I created a new page with the curl function. Then in step 2, I use the fsockopen to process that new page. Now the form user gets right to the submission page quickly since the curl process is carried out in the background.
So my question? Is this the right way to be doing things? Is there a better way and maybe better yet, is this secure?
Thanks!
b