Re: Retrieving Image Location in PHP from MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 9, 2009 at 7:32 AM, Sashikanth Gurram <sashi34u@xxxxxx> wrote:

> Hi,
>
> Yes, the problem was solved, but It did not work fine when I used the same
> code in my larger file. Now it makes sense.


right, just track down where you started sending the output, and remember if
youre going to use header() calls in your scripts, that all of them must
come before sending any of the standard content.


> Let me just repeat what you have said just to make sure that I did not
> misread you.
> So you say that the solution to this problem is to create another php file
> with the image fetching header and just write an img tag  <img
> src="myimagescript.php?id=1234" /> in my original php file (with the html
> tags).


what i explained in my first response is that youre mixing 2 different
approaches, and it was unclear what you were going for exactly.  if you want
to have an image included in a page of html, then theres no need for the
header() call (refer to my first response for the remaining details).  there
are however legitimate use cases for the use of header() & the
aforementioned image methods, i think between mine and some of the other
posts on this thread, its explained clearly.


> This is what I have understood.
> Regarding the point you have mentioned ( If you set the content type using
> header() to "image/jpeg", do not use HTML tags to display your image!),


correct


> I definitely need the HTML tags, because this application works based on
> the user input. So unless there is not input through a html form, it wont
> work.


right, then just configure your webserver such that you can first access the
image directly via an http url, then integrate these links into your dynamic
pages as i explained in my first response.

good luck,

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux