poddys Posted August 30, 2012 Share Posted August 30, 2012 I have a system that runs under Localhost and which uses Fopen to connect to an online system when the user logs in. If there is no internet connection, the Fopen fails immediately and the script catches that perfectly. If there is internet connection and the url is found, it is executed fine. The problem I am having is where there is an internet connection, but the url is not available, which happens if the user is using the wrong connection while in the office. In this case, the browser waits for about a minute, then gives a 500 error (MSIE). Is there an easy way to set a shorter timeout for this, so if the site/url cannot be found, the command fails? The reason for having the offline system is for engineers who have to create reports, but are often in environments where there is no network connection. They work offline and then upload the reports to the online system. As part of the login process, a script is run to download updates to tables, which only takes place if they are online of course. Quote Link to comment https://forums.phpfreaks.com/topic/267813-fopen-timeout-problem/ Share on other sites More sharing options...
scootstah Posted August 30, 2012 Share Posted August 30, 2012 You can specify a timeout for fsockopen. Quote Link to comment https://forums.phpfreaks.com/topic/267813-fopen-timeout-problem/#findComment-1373920 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.