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(’|
echo “”;
}
?>[/code]
And the form
[code]
Anyone can see any errors in the code? Or tell me why the difference in the browsers shows up.