Shoutbox

php script... - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: General (/forumdisplay.php?fid=11)
+---- Forum: General Chit Chat (/forumdisplay.php?fid=14)
+----- Thread: php script... (/showthread.php?tid=28541)

php script... by Eric on 07-12-2004 at 04:35 AM

Ok you guys know about the php script for displaying a random image with every refresh...but theres another php script that embeds an image within the .php/.php3/.phtml file, that is, you don't have to link to an external site to retrieve the image, or you don't need to upload it anywhere, saving space....well my request is...would anyone be kind enough to make such a script for me? please?:D


RE: php script... by WDZ on 07-12-2004 at 04:55 AM

quote:
Originally posted by Eric
saving space
Not really... if the image data is inside the php file, it's still taking up that space. :p Actually, it would take even more space, because you must encode the binary data to make it safe for storage in a PHP script. Encoded data is about 33% larger.
RE: php script... by GJ-tje on 07-12-2004 at 07:02 AM

The attachment, is a PHP-script, that just randomly selects an image, and views it. I use it too, for my avatar ;)
The script doesn't encode it, into it's own, due to the need of 30% of more space, like WDZ said before ;)

It works with .jpg and it's not been tested with .png or .gif

Enjoy! :D

[edit]
Maybe your script doesn't work, due to the Lycos banner... ;)
Oh and The PHP-support at Lycos sucks (at least for Lycos Netherlands...) :)
Maybe you can put the script on some webspace of your provider...


RE: php script... by Eric on 07-12-2004 at 11:50 AM

i know why it doesn't work, I was asking for something else, I don't care if it takes up more space, I wanna store it INSIDE the .php file.

Edit: Besides, I only want to store only ONE image in the .php file, not multiple files that are displayed randomly.

someone please make a script that can take a picture and store it INSIDE a .php file(I want it for my sig)



mod: can we start using this button please -  [Image: edit.gif]
RE: RE: php script... by GJ-tje on 07-12-2004 at 02:05 PM

quote:
Originally posted by Eric
someone please make a script that can take a picture and store it INSIDE a .php file(I want it for my sig)

As far as I can see, you allready got such an script wich does it, and if you want it really fast, you could make it yourself...

http://www.php.net
http://www.google.com

Those sites can help you if you want to create a script on your own...

We are just members on a forum... Not a helpdesk, to do stuff for you...

O and 1 question? Why do you want it? My PHP-script DOESN'T store the image inside the script... And does work HERE too... ;)
You can get my PHP-script in one of my previous posts in this topic ;)
RE: php script... by Eric on 07-12-2004 at 02:10 PM

lol I don't want it for random images, I just want to store a picture inside a php file for another reason


RE: RE: php script... by GJ-tje on 07-12-2004 at 02:11 PM

quote:
Originally posted by Eric
lol I don't want it for random images, I just want to store a picture inside a php file for another reason

Maybe a stupid question, but what is that reason? Maybe there are other solutions for it... ;)
RE: php script... by Stigmata on 07-12-2004 at 02:27 PM

his server may not allow remote linking on images


hmmmm ok try this, open a image in notepad

code:
<?php
    header("Content-type: image/bmp");
    echo base64_decode('enter all those image crap numbersletter etc here');
    ?>



mod: can we start using this button please -  [Image: edit.gif]
RE: RE: php script... by GJ-tje on 07-12-2004 at 02:29 PM

quote:
Originally posted by jackass_wanabe
hmmmm ok try this, open a image in notepad

code:
<?php
    header("Content-type: image/bmp");
    echo base64_decode('enter all those image crap numbersletter etc here');
    ?>

He wants randomly images, not just one... So PHP needs to read a random image... and than later put al the 'text' trough base64_decode I guess...
RE: php script... by CookieRevised on 07-12-2004 at 02:34 PM

quote:
Originally posted by Eric
lol I don't want it for random images, I just want to store a picture inside a php file for another reason

RE: php script... by Eric on 07-12-2004 at 02:34 PM

thanks jackas and no its not that my server does not allow remote linking, infact it does, I want to use it for a project


RE: RE: php script... by GJ-tje on 07-12-2004 at 02:36 PM

quote:
Originally posted by Eric
thanks jackas and no its not that my server does not allow remote linking, infact it does, I want to use it for a project
Dont want to be rude... But a project with your avatar? 8-) ^o)

But back on-topic... If you want a PHP-script, that does that... Maybe it's easier for that person to know WHY he has to make it for you... Maybe there are better solutions for it do...
RE: php script... by Stigmata on 07-12-2004 at 02:38 PM

quote:
Originally posted by Eric
thanks jackas and no its not that my server does not allow remote linking, infact it does, I want to use it for a project


;)

RE: php script... by Eric on 07-12-2004 at 02:43 PM

hmm doesnt seem to work


RE: RE: php script... by GJ-tje on 07-12-2004 at 02:44 PM

quote:
Originally posted by Eric
hmm doesnt seem to work

What were you trying to do then? :S
RE: php script... by Eric on 07-12-2004 at 02:46 PM

can you upload an attachment .php file like this as an example?

btw the post was directed to jackas



mod: can we start using this button please -  [Image: edit.gif]
RE: RE: php script... by GJ-tje on 07-12-2004 at 02:49 PM

quote:
Originally posted by Eric
can you upload an attachment .php file like this as an example?

I allready did, just check the first post of me, in this topic... ;)

Or did you mean something else? If so, could you explain it please?
RE: php script... by Eric on 07-12-2004 at 05:19 PM

Wtf!? GJ, its better if you stay out of this, no offense, but you seem to be a bit confused and clueless. Just leave it to the experts ;)


RE: php script... by KeyStorm on 07-12-2004 at 05:52 PM

quote:
Originally posted by Eric
Wtf!? GJ, its better if you stay out of this, no offense, but you seem to be a bit confused and clueless. Just leave it to the experts



Let him do :P, it's better if we have more experts. Some experts will have to teach others in order to make them experts, right?

Well, Gj, what's the problem right now?
Tell us exactly what you want, how you want it and what is keeping you from achieving it right now? ;)

Edit: Btw, I used base64 for my KSMAS project, you may take a look at it.
RE: php script... by Stigmata on 07-12-2004 at 06:02 PM

k sorry i no what i did wrong, under the bmp header, write another header info below

code:
header("Content-length: +number+");


RE: php script... by Eric on 07-12-2004 at 06:08 PM

k I think that this works for bmps only, is there anyway to do it with animated gifs or pngs. I don't think it will work with animated gifs but still its worth a try :D


RE: php script... by Stigmata on 07-12-2004 at 06:09 PM

rename the header  :S


RE: php script... by KeyStorm on 07-12-2004 at 06:09 PM

Oh, I see. You probably need the "Content disposition" header
use:

code:
header('Content-disposition: inline; filename=example.bmp');

You may want to define the diposition as attachment (instead of inline) if you want the image to prompt a download dialog instead of showing in the browser.

Btw, Content-length is not really needed, but it's "good protocol" to add it. ;)
RE: php script... by Stigmata on 07-12-2004 at 06:12 PM

quote:
Originally posted by KeyStorm
"good protocol"



and im a good boy :)

and ive already given that header :S
RE: php script... by KeyStorm on 07-12-2004 at 06:16 PM

I never gave that header in KSMAS :S :P

It's rather a good compatible behaviour to add as many headers as possible.

* KeyStorm adds content-length to KSMAS :D8-)


RE: php script... by Eric on 07-12-2004 at 06:30 PM

ok lets see man, I write the following into a .php file in notepad:
<?PHP
    header("content-type: image/bmp)
    header("content-length: 28962")
    header("content-disposition: inline; example.bmp")
    echo base64_decode(.....)
?>

ok so what now? I open a bmp file in notepad and copy the crap I see in notepad and paste it into the php file?


RE: php script... by KeyStorm on 07-12-2004 at 06:34 PM

:google:, please!

http://www.mustardlab.com/developer/test/base64.php


RE: php script... by Eric on 07-13-2004 at 03:55 AM

hmmm i ll just use my MySQL Db....thanks anyway


RE: php script... by leito on 07-13-2004 at 05:07 AM

some :google: could help:

Base64img, will give you the complete code, in a way you understand it.
I try an animated gif, and works great!
PNG also works, nice.


RE: php script... by Eric on 07-13-2004 at 02:47 PM

well i don't have access to the tmp file in my host so I cant make it writable, so it doesnt work, it would be cool if someone uploads it on his/her site and let me use it lol


RE: php script... by Eric on 07-13-2004 at 03:50 PM

WAZZA it worked!!


RE: php script... by KeyStorm on 07-13-2004 at 04:03 PM

Well, finally. Don't double-post. Use the [Image: edit.gif] button instead please.