|
Posted by Oli Filth on 12/17/05 20:34
Peter Jay Salzman said the following on 17/12/2005 17:07:
> I'm writing a blogging app that uses an image file of a short string that
> users need to type in to comment. I've heard it called a "captcha" system.
>
> The problem is that the file that creates string and the image of the string
> can't access $_SESSION, and so has no way of passing the string to the
> receiving form.
>
>
> captcha2.php:
>
> // Create the string.
> (snip)
>
> // Define colors and create the image.
> (snip)
>
> imagestring ($image, 5, 1, 1, $cmntPass, $colorBlue);
> ImagePNG( $image );
> ImageDestroy( $image );
>
> session_id( $_REQUEST['PHPSESSID'] );
> start_session();
> $_SESSION['captcha'] = $cmntPass;
>
Firstly, there is no function called start_session(), it's session_start().
Secondly, there must be *no* output from a script before session_start()
is called.
If you had had error_reporting set to E_ALL, you would already have
spotted these mistakes... ;)
--
Oli
[Back to original message]
|