|
Posted by Rik Wasmus on 11/21/07 23:57
On Thu, 22 Nov 2007 00:50:46 +0100, <jools@by.com> wrote:
> No guys thanks but its nothing to do with not closing files or stuff l=
ike
> that.
>
> OK - good and bad news...
>
> First my debug code was responding with a wrong error line - it isnt t=
he
> text file thats missing its the graphic (<img>) line after it.
>
> Thats the good news...
>
> So I've done as Rik suggested and removed all my code then replaced it=
> with the minimal code that causes the problem and removed the faulty
> debug code. So I'm now working in a plain text editor.
>
> /// Simplest instance of the problem ...
>
> First - these three lines are cut/paste from my actual file -
>
> $mypath =3D '../foot.gif';
> echo("<img src=3D$mypath alt=3D'File missing'>");
> unlink($mypath);
>
> What happens is the output says 'File missing' and never displays the
> foot.gif and foot.gif has been deleted.
Indeed. You said you did output some filecontents, not the name of a fil=
e. =
In this case, there's practically no way the user wil ever be able to =
download the image. An HTML tag is NOT sending the image, it's just =
telling the browser where it can be fetched.
If you need an dynamically created image displayed only once, and not =
saved permanently as a file, point the HTML src attribute to a PHP scrip=
t, =
possibly with some GET variables, and let that script output an image, =
using the GD or ImageMagick libraries for instance.
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|