Jump to content


Photo

Problem: Headers: Content Type


  • Please log in to reply
2 replies to this topic

#1 phirewerkz

phirewerkz
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 March 2006 - 10:01 PM

Hello there,

I'm not sure if this is a newb question, but just to be safe, I'm posting it here:

I'm currently setting up a site which a php news posting script that reads from mySQL database. Thus, when I'm loading the main page, it's reading html/text data from the database and displaying it on the main page.

I've also found a nifty PHP/GD script that dynamically adds watermarks to pictures and displays them automatically. However, this script requires a header to be sent initially that tells the browser to expect image/jpeg format. When I run this php script alone, the picture loads fine (with the new watermark).

However, my problem is that I want to display this picture on the main page, along with the news posts. So, I have two conflicting data types (I think?). When I use this jpeg/html header, the main site only displays the URL (as a jpeg format). If I take out the header (implied to default html/text), then the main page loads fine, except the picture is now being displayed in text (elsfkjselfj#$LJL$JTLJLJ, etc..).

Is there a solution to this problem, or is it impossible to be able to display multiple content types ? If not, can you think of any other possible solutions?

Many thanks,

phirewerkz

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 05 March 2006 - 11:14 PM

Without seeing any code, the probable solution is to use your image creation script as is (i.e. with the correct header type) and call it from the page display script via <img src="myscript.php">
Legend has it that reading the manual never killed anyone.
My site

#3 phirewerkz

phirewerkz
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 March 2006 - 01:30 AM

[!--quoteo(post=351924:date=Mar 5 2006, 06:14 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Mar 5 2006, 06:14 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Without seeing any code, the probable solution is to use your image creation script as is (i.e. with the correct header type) and call it from the page display script via <img src="myscript.php">
[/quote]

Great! I took what you said and tried it and it worked out perfectly! Thanks so much for your help!

Take a look here: [a href=\"http://phire.x3fusion.com/v4/\" target=\"_blank\"]http://phire.x3fusion.com/v4/[/a]


However, when looking at the source, the src right now is watermark.php?imageToMark=bmw_thumb...is there a way for it just to display bmw_thumb.jpg so that users won't know that its a just a script......
Cheers!

phirewerkz




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users