Page 1 of 2

header information

Posted: Sat Nov 01, 2003 12:53 pm
by kendall
Hi,

I didnt no where to post this so if some one has an appropirate place...thanks

My question deals with using the header() to output content type based on a filename in php

now i no header(Content Type: text/html) is fo HTML
and header(Content Type: image/jpeg) is fo JPEG

but is there something 'standard' that can be used to header() whether its jpeg, gif, html, php , text, swf, a g-string thong, or a nut?

Posted: Sat Nov 01, 2003 12:54 pm
by Cruzado_Mainfrm
i don't think so, because text is text and binary is binary

Posted: Sat Nov 01, 2003 11:49 pm
by JAM
Actually, text/html? Does that exists really?

Anyways, http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc1494.html
Perhaps you will find more info there.

Posted: Sun Nov 02, 2003 7:15 pm
by m3mn0n
[big_search]mime types[/big_search]

Posted: Sun Nov 02, 2003 8:43 pm
by d3ad1ysp0rk
wow Sami, you really love these new forum features don't you? :P

Posted: Mon Nov 03, 2003 7:35 pm
by m3mn0n
Oh yeah. 8)

Posted: Tue Nov 04, 2003 12:31 pm
by kendall
What about .swf files

are the image/swf or text/swf

KEndall

Posted: Tue Nov 04, 2003 1:04 pm
by Gen-ik
kendall wrote:What about .swf files

are the image/swf or text/swf

KEndall
SWF files are application/x-shockwave-flash

Posted: Tue Nov 04, 2003 1:10 pm
by kendall
Gen,

Goosh!!!! this is even harder than i thought...

I wanted to build an advertisement system that will display images, html or swf files.

I thought i would have been as simple as a header() or an include but dang this is getting really far ahead of me

Kendall

Posted: Tue Nov 04, 2003 1:40 pm
by d3ad1ysp0rk
include ("$filename");

whats wrong with that?

Posted: Tue Nov 04, 2003 1:49 pm
by JAM
LiLpunkSkateR wrote:include ("$filename");

whats wrong with that?
When i think of adverts (and PHP combined) I think of the earlier discussions there have been using:
<img src="http://www.example.com/advertisment.php?id=23" />

advertisment.php is a script, that takes the id and returns 'something' based on that. If id 23 points to a .jpg, the script needs to send the correct headers for the image to show.

Take Jason's avatar on this forum. That avatar is really a random image generator script, working basicly the same way. Using include('file') will not work in this case.

If this is kendall's case, I do not know, but at least I might have shared some light on the subject. ;)

Posted: Tue Nov 04, 2003 2:14 pm
by kendall
JAM,

well i wish it was as simple as jpeg images well it cud be but im exploring the use of html and swf as advertisement files so i was researching options for using html headers and swf headers but the headers for these
are very different so im thinking i have to do some conditioning...just wanted to know what people do in these cases

Posted: Tue Nov 04, 2003 2:24 pm
by d3ad1ysp0rk
so why not just have the person using your advertising service go:

Code: Select all

&lt;?PHP include ("http://www.example.com/script.php?id=4858") ?&gt;
and on script.php have something that randomly picks and displays it using the correct tags

Code: Select all

<?PHP 
display[0] = <img src="http://www.example.com/pic.gif">;
display[1] = <img src="http://www.example.com/pic2.jpg">;
display[2] = <flash tags = "http://www.example.com/flash.swf">;
display[3] = <a href="http://www.example.com/redirect.php?link=39">;

echo $display[random];
?>

sorry if im totally off base, but this is my first time trying something like this and it seems like it should work..

Posted: Tue Nov 04, 2003 2:56 pm
by kendall
lilPnuk,

Im using a database with a click stat position and stuff...sometimes i ask myself...why do i make things so hard...then i tell my self....because im an idiot...we do thing the hard way :D

even if i include i would have to do a number of header() combinations but i was also catering for a non-php world so i rezorted to using <script src="file.php"> scenario which would have allowed me to document.write the result but that has grown more difficult

i think im gonna go with the include i jus have to find the rite method of diaplying based on the type of file...
believe it or not there is a mime_content_type() that cud have solved my issues but gosh DARN it my IHP's have screwe me...again.

yes things are jus F@#! up wid me today

going and have a beer [henikin]
later

Kendall

Posted: Tue Nov 04, 2003 3:24 pm
by JAM
kendall wrote: going and have a beer [henikin]
later

Kendall
Can't... resist... replying...
But spelling Heiniken as henikin tells me that you allready had one or fifteen allready :wink: