Forum Moderators: coopster

Message Too Old, No Replies

Need help with PHP

This is so simple but I am a beginner so don't laugh at me please

         

haryanto

5:23 am on Mar 8, 2004 (gmt 0)

10+ Year Member



Hi guys,

This is easy I think but I am beginner so please help me out with this.

I have 2 servers. I need to include a page from a page on server 1, in case server 1 goes down I want the page to include it from server2.
How do I do that?

Please help!

daisho

3:25 am on Mar 9, 2004 (gmt 0)

10+ Year Member



Is a 3rd server doing the include? Is the include in PHP?

daisho.

haryanto

6:39 am on Mar 9, 2004 (gmt 0)

10+ Year Member



HI buddy,

The include script can be on anyserver.
In fact it will be on couple of servers.
How do we work this situation?

lorax

1:01 pm on Mar 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well if you have a MySQL db on the servers you could use mysql_ping() [php.net] to check the server.

daisho

1:54 pm on Mar 9, 2004 (gmt 0)

10+ Year Member



Or use cURL with a slow timeout. If the first fails then try the second.

I think that Lorax's option would be a little faster though if there was a failure.

daisho.