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 17 08:02

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"?

On Sat 17 Dec 05, 12:15 AM, Rod Roark <rod@sunsetsystems.com> said:
> On Friday 16 December 2005 11:24 pm, Peter Jay Salzman wrote:
> > ... No matter what I try, though, I
> > can't access sessions from the captcha2.php file.  I guess it must interfere
> > with the image being sent to the client.
> Oooh.  It must be that there's no mechanism for the browser to send
> the cookie (which contains the session ID) when it requests an
> image.  Sorry I caused you so much trouble.
> I think what may work is to send the session ID in the URL.  That is,
> construct the image URL like this:
>   $url = 'captcha2.php?' . session_name() . '=' . session_id();
> and then your form requests the image with:
>   <img src='<?php echo $url ?>'>
> or whatever the equivalent is with Smarty.
> I have not tried this, it's just my best guess from reading the docs.
Thanks Rod!

Unfortunately, it's still not working.  Here's what I tried:

Smarty template/web page "view_by_permalink.php":

   $smarty->assign('sessionId', session_id());
   $smarty->assign('sessionName', session_name());

   <img src="captcha2.php?{$sessionName}={$sessionId}" alt="validation string" />


   session_id( $_REQUEST['PHPSESSID'] );
   $_SESSION['captcha'] = $cmntPass;

Using error_log(), I determined that in captcha2.php, $_REQUEST['PHPSESSID']
is the correct session ID.  But something isn't right because if I stick

   error_log('hello world');

in captcha2.php before start_session(), the message appears in my error log.
But if I stick it in after start_session(), it doesn't appear.  So PHP seems
to be very unhappy with the start_session() line.

Needless to say, 'captcha' is an undefined $_SESSION index in the receiving

I'm really on ground here.  I'm reading, but there's enough documentation to
drown in.

Have any idea on how to proceed?

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:
EDGE Tech Corp.
For donating some give-aways for our meetings.