Catch When cURL can't connect to webserver
If a domain is invalid or a web server is down, cURL will return false and not have a status code. We need to catch it and distinguish the difference between page not found and cannot connect for the user.
This commit is contained in:
@ -124,9 +124,14 @@ define('CONN', (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "")?'http':'ht
|
||||
<td>onfail</td>
|
||||
<td>[url of .jpg]</td>
|
||||
<td>If the page can't be reached, this image will be displayed instead</td>
|
||||
<td><?php echo CONN; ?>://<?php echo DOMAIN; ?>/img/failed.jpg</td>
|
||||
<td><?php echo CONN; ?>://<?php echo DOMAIN; ?>/img/pagefailed.jpg</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ondomainfail</td>
|
||||
<td>[url of .jpg]</td>
|
||||
<td>If the web server can't be reached, this image will be displayed instead</td>
|
||||
<td><?php echo CONN; ?>://<?php echo DOMAIN; ?>/img/domainfailed.jpg</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>cache</td>
|
||||
<td>[any alphanumeric string]</td>
|
||||
|
Reference in New Issue
Block a user