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.


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 {

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


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

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


And the form



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="" id="picture" /> </td> </tr>

<tr valign="middle"> <td align="center" style="width: 557px;"> <img src="" id="picture" /> </td> </tr>



Check out how it looks on my site. Test with firefox and IE

Sponsor our Newsletter | Privacy Policy | Terms of Service