html/php code that downloads a pic?

All about creating websites!
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
19
Contact:

html/php code that downloads a pic?

Post 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 :/

User avatar
H4evr
On the way to fame!
On the way to fame!
Posts: 43
Joined: 30 Apr 2006, 16:00
18
Location: Portugal
Contact:

Post 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.

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
19
Contact:

Post by ayu »

hmm ok, so this only downloads and saves it once? or?

User avatar
H4evr
On the way to fame!
On the way to fame!
Posts: 43
Joined: 30 Apr 2006, 16:00
18
Location: Portugal
Contact:

Post by H4evr »

yes that's it. due to the browser. I don't know how to bypass this.

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
19

Post 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'.
Last edited by Gogeta70 on 04 Jun 2006, 17:28, edited 1 time in total.
¯\_(ツ)_/¯ It works on my machine...

User avatar
H4evr
On the way to fame!
On the way to fame!
Posts: 43
Joined: 30 Apr 2006, 16:00
18
Location: Portugal
Contact:

Post 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 :(

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
19
Contact:

Post 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?

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
19

Post 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.
¯\_(ツ)_/¯ It works on my machine...

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
19
Contact:

Post 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?

User avatar
H4evr
On the way to fame!
On the way to fame!
Posts: 43
Joined: 30 Apr 2006, 16:00
18
Location: Portugal
Contact:

Post 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

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
19
Contact:

Post by ayu »

1 yes

2 yes ^^

User avatar
FrankB
Ph. D. in Sucko'logics
Ph. D. in Sucko'logics
Posts: 315
Joined: 06 Mar 2006, 17:00
18
Location: Belgistahn
Contact:

Post 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

User avatar
H4evr
On the way to fame!
On the way to fame!
Posts: 43
Joined: 30 Apr 2006, 16:00
18
Location: Portugal
Contact:

Post by H4evr »

neo130 wrote:1 yes

2 yes ^^
Ok

FrankB's suggestion looks good to me.

User avatar
FrankB
Ph. D. in Sucko'logics
Ph. D. in Sucko'logics
Posts: 315
Joined: 06 Mar 2006, 17:00
18
Location: Belgistahn
Contact:

Post 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...

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
19
Contact:

Post 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

Post Reply