You are here: Re: Sessions are driving me to insanity « PHP Programming Language « IT news, forums, messages
Re: Sessions are driving me to insanity

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация