Php-script works different i firefox and IE

Here is the deal. A site with pictures that you can’t “right-click save”-from. I’ve got a script that searchs thru the site and finds the picture and shows it on my page. But there are som errors.

The page is like:

Typ the adress here… [form] OK [button]
“picture shows up here” [picture]

In firefox the page just refreshes and no picture. In IE the picture will show up (but with errors so just the small box with a red cross).

Here is the code.

[code]<?php

if(!empty($_POST[‘link’])){
function get_contents($url){
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$contents = curl_exec($ch);
if (curl_errno($ch)) {
$contents = ‘’;
} else {
curl_close($ch);
}

  if (!is_string($contents) || !strlen($contents)) {
    $contents = '';
  }
  
  return $contents;

}

$f = get_contents($_POST[‘link’]);
$f = str_replace(“n”, “”, $f);
$f = str_replace(" ", “”, $f);
preg_match_all(’|

|i’, $f, $out);
echo “”;
}

?>[/code]

And the form

[code]

[/code]

Anyone can see any errors in the code? Or tell me why the difference in the browsers shows up.

What’s the HTML part of the image look like? What’s in the src="" attribute of the image?

Here come som exampel. I hope I get you right on this.

<tr valign="middle"> <td align="center" style="width: 557px;"> <img src="http://images1.bilddagboken.se/22/_u6/_u7/_u2/_u9/_u3/u672936/73859_1191855975.jpg" id="picture" /> </td> </tr>

<tr valign="middle"> <td align="center" style="width: 557px;"> <img src="http://images3.bilddagboken.se/13/_u8/_u2/_u4/_u6/u82466/39957_1188212980.jpg" id="picture" /> </td> </tr>

[code]




		</tr>[/code]

Edit:
Check out how it looks on my site. Test with firefox and IE http://tpice.info.se/

Sponsor our Newsletter | Privacy Policy | Terms of Service