How to tell if Mime type matches contents



Hi Everyone,

Before I write the script myself, I'm looking for PHP code that checks
that a link's content type matches it's contents. I need this for my
"broken link" checker script, which fails to spot the "broken" links
http://www.awin1.com/show.php?mid=1014&linkid=36515&aid=49007 and
http://www.awin1.com/awclick.php?mid=1014&linkid=36515&id=49007. Any
ideas?

BTW, in case the links get fixed before you read the message, the first
link is a GIF MIME that returns
-----------------------
The image
"http://www.awin1.com/show.php?mid=1014&linkid=36515&aid=49007";
cannot be displayed, because it contains errors.
-----------------------

The second is a text/html that returns
-----------------------
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index
30 in /home/sites/site3/web/awclick.php on line 51

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in /home/sites/site3/web/linkdeliveryfunctions.inc.php
on line 178

Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in /home/sites/site3/web/linkdeliveryfunctions.inc.php on line
478

Warning: Cannot modify header information - headers already sent by
(output started at /home/sites/site3/web/awclick.php:51) in
/home/sites/site3/web/linkdeliveryfunctions.inc.php on line 462

Warning: Cannot modify header information - headers already sent by
(output started at /home/sites/site3/web/awclick.php:51) in
/home/sites/site3/web/awclick.php on line 235
-------------------------------------------------------

Thanks,
Ed

.



Relevant Pages

  • Warning Message
    ... connecting to a secure web site. ... The user accesses a site over the web the ... "Warning. ... Cannot modify header information - header ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: [PHP] Problem with Redirect
    ... Warning: Cannot modify header information - headers already sent ... You could also consider not doing a redirect at all, ...
    (php.general)
  • Headers already sent problem online, but not offline
    ... script and run it, it says the headers have already been sent. ... the script, and the information about the file is read out from a database, ... Warning: Cannot modify header information - headers already sent by (output ...
    (comp.lang.php)
  • Re: Splitting uploads up/ concatenating them back together
    ... my downloader script looks like this: ... Warning: file_get_contentsexpects parameter 1 to be string, ... Warning: fclose: supplied argument is not a valid stream resource in ... Cannot modify header information - headers already sent by ...
    (comp.lang.php)
  • Re: [PHP] Could some one check my code
    ... : i am getting this error returned but i dont know why:( ... : Warning: mysql_fetch_array: supplied argument is not a valid MySQL result ... in which case it returns a boolean FALSE. ...
    (php.general)