$php_mysql$ Posted September 1, 2011 Share Posted September 1, 2011 so im trying to display error message which is (Error!</font> Currently no updates available.) if nothing from the url returns but all i see is the error message when i try to check for error the data which is available does not show. why so? function weather(){ $ch = curl_init("http://www.domain.com/weather.html"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if(curl_errno($ch)){ $page = curl_exec($ch); preg_match('#<table[^>]*>(.+?)</table>#is', $page, $matches); foreach ($matches as &$match) { $match = $match; } echo '<table height=\"200px\">'; echo $matches[1]; echo '</table>'; }else{ echo "<table>"; echo "<tr>"; echo "<td>"; echo '<font align="center" color="red">Error!</font> Currently no updates available.'; echo "</td>"; echo "</tr>"; echo "</table>"; } } Link to comment https://forums.phpfreaks.com/topic/246219-help-with-curl-error-message/ Share on other sites More sharing options...
$php_mysql$ Posted September 2, 2011 Author Share Posted September 2, 2011 anyone? Link to comment https://forums.phpfreaks.com/topic/246219-help-with-curl-error-message/#findComment-1264648 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.