View Full Version : trap no connection error

08-30-2011, 11:13 PM
I have an auto submit form in a php file that verifies some remote information from my customer files to my files on my host server.

I was just thinking what would happen if the power of my host went down, or for some other reason cannot connect. In case that happens i want to trap the no connection error rather than my customer get an invalid verify.

How do i trap when the auto submit form cannot connect to the action http url. And then show a special message just for that. That way they know its not me its my host thats down.

i was sort of thinking 408 or 404 trap or maybe even a 503 but it says to handle that as 500, so not sure.

08-30-2011, 11:22 PM
You cannot. If you're HTML action points at a remote location, there is no interaction on you're part. You need to submit to yourself and use curl or sockets to communicate with the remote script and can determine from that what the results are. If its not 200, there is a problem.

08-30-2011, 11:27 PM
its actually my customers html auto form that points to my site on a host shared server, but i think i get what your saying, since im on a shared server there is just no way if its not 200.

Now if i had my own server and my customers html auto form came to my server then that would be quite dif correct and i could trap that.

I think i understand..

08-30-2011, 11:43 PM
Yep, any time the direct connection is severed for whatever reason, there is no way to trap it. Only if you move it from one location to another can it be trapped.