$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>"; } } Quote 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? Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.