Hi all,
I have an online form, this form must be sent to another server that will parse it. If that server is down, all form data should be queued, also this way data will only be sent from our site's IP address, to prevent DDos attacks.
Anyhow, how do I do this queuing thing? Should I create a SOAP envelope, is a web service needed?
I would apreciate any help anyone can provide.
Thanks
How do I do this? Is it a web service?
Moderator: General Moderators
-
Klaws_wolverine
- Forum Commoner
- Posts: 32
- Joined: Mon Sep 29, 2003 10:11 am
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
not sure if queueing is possible
unless you do somethng to the effect
if
//connection possible
send
else
//connection not possible
store in MySQL
try googling i have no idea, btw there are several software that can do this
http://www.hotscripts.com/PHP/Scripts_a ... more4.html
unless you do somethng to the effect
if
//connection possible
send
else
//connection not possible
store in MySQL
try googling i have no idea, btw there are several software that can do this
http://www.hotscripts.com/PHP/Scripts_a ... more4.html
-
Klaws_wolverine
- Forum Commoner
- Posts: 32
- Joined: Mon Sep 29, 2003 10:11 am
not a mailing list
Hi,
Actually I cannot use those scripts at the link, because it's form data that will be sent, not an smtp email.
I need to know how to do this with a web service, and from what i've heard, it will be queued and web services takes care of that for you.
Thanks
Actually I cannot use those scripts at the link, because it's form data that will be sent, not an smtp email.
I need to know how to do this with a web service, and from what i've heard, it will be queued and web services takes care of that for you.
Thanks
Re: not a mailing list
If you decide to implement queue by yourself, I'd suggest the following `hand-made` design:Klaws_wolverine wrote: I need to know how to do this with a web service, and from what i've heard, it will be queued and web services takes care of that for you.
1. script, say accept.php, accepts the data from the customer and place it into queue (mysql db or file or something).
2. another script, either the standalone daemon or cron job retrieves the data from queue and posts it to remote processing server (You can do it using [php_man]curl[/php_man] extension).
-
Klaws_wolverine
- Forum Commoner
- Posts: 32
- Joined: Mon Sep 29, 2003 10:11 am
Yes, that's it
Hi Weirdan,
While it is in the queue line, does it have to go into mysql or in a file, can't it be in-memory?
Regarding your accept.php and ur curl function, would you be so kind as to provide some snippets of code? And I don't know curl at all, what's the learning curve?
I would apreciate any help anyone can give me. I was initially think of doing this with NuSOAP.
Thanks
While it is in the queue line, does it have to go into mysql or in a file, can't it be in-memory?
Regarding your accept.php and ur curl function, would you be so kind as to provide some snippets of code? And I don't know curl at all, what's the learning curve?
I would apreciate any help anyone can give me. I was initially think of doing this with NuSOAP.
Thanks
Re: Yes, that's it
It can't, I guess. What if the server which hosts accept.php is crashed before it has submitted the data to processing server?Klaws_wolverine wrote:While it is in the queue line, does it have to go into mysql or in a file, can't it be in-memory?
Curl: first, read the manual, this extension has pretty straightforward syntax. It's as simple asKlaws_wolverine wrote: Regarding your accept.php and ur curl function, would you be so kind as to provide some snippets of code? And I don't know curl at all, what's the learning curve?
Code: Select all
$ch=curl_init("http://remote.server.com/remote/page.php");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,array("first_field"=>"something","second_one"=>"something_else"));
$result=curl_exec($ch);
// now $result variable holds the remote server responseSimple form processing page which stores the data into db.
Writing a daemon can be a bit tricky, I'd suggest not to go this way if you haven't ever wrote one