l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2005 Dec 16 08:08

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] when is an html image "sent"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] when is an html image "sent"?

nope.  just have it expire after 20 seconds or something.  you're
keeping a log of the captacha phrases, too, so just delete them
together.  --Philip Neustrom

On 12/16/05, Peter Jay Salzman <p@dirac.org> wrote:
> hi all,
> i'm writing a blogging system called peetblog.  you can see a demo at
> http://www.dirac.org/blog.  i haven't really linked to it much because it's
> still under active development.
> one of the features is a captcha system (an image file of letters/numbers
> that someone needs to type in to comment on a post).  the code looks
> something like this:
>    ///   Captcha
>    $retval = createImage();
>    $filename = $retval['filename'];
>    $passkey  = $retval['passkey'];
>    $smarty->assign('filename', $filename);
>    $smarty->assign('passkey', $passkey);
>    $smarty->assign('id', $the_id);
>    $smarty->assign('login', $_SESSION['user']->login);
>    $smarty->assign('email', $_SESSION['user']->email);
>    $smarty->assign('www', $_SESSION['user']->www);
>    $smarty->display('permalink_C.tpl');
>    // Footer
>    //
>    $smarty->assign('me', $selfUrl);
>    $smarty->assign('rss', "$pb_url/$pb_rss");
>    $smarty->display('footer.tpl');
>    unlink($filename);
>    exit(0);
> footer.tpl contains the ending "</body></html>", so the page content ends
> right there.  The <img> tag is contained in the permalink_C.tpl template.
> The problem is that when:
>    unlink($filename);
> is used to delete the temporary image file, the image doesn't appear on the
> webpage.  however, if i don't use "unlink", then the image files tend to
> collect until i hand delete them.
> i suppose at some point, the image needs to be sent from server to client.
> when that happens, it would be ok to delete the image file.  i was *hoping*
> that this would happen immediately after </html> is sent, but it appears
> that i'm wrong.
> is there some kind of technique I can use to make sure the image file gets
> deleted after it's shipped off to the client?
> thanks,
> pete
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!