You are here: Re: How do you acceess $_SESSION from within CLI PHP script? « PHP Programming Language « IT news, forums, messages
Re: How do you acceess $_SESSION from within CLI PHP script?

Posted by Gordon Burditt on 04/27/06 06:19

>Is it possible to access values preset from $_SESSION from within a CLI
>PHP page?

There are no sessions for command-line PHP. There aren't any "pages",
either, just command scripts. Also no $_GET, $_POST, $_REQUEST, or $_COOKIE.
But there are command-line arguments.

>If so, how is it done? Each time I try to access $_SESSION
>is an empty array; the moment I leave the CLI PHP and return to my
>calling web-app PHP script, $_SESSION is back again, values and all,
>completely untouched.

>Can $_SESSION be called?

How does one "call" something that's not code? You could pass command-line
arguments. Those are strings, not arrays.

>If not, then I have a bigger problem inasmuch
>as $_REQUEST variables set via form/query-string MUST be accessed from
>within CLI PHP script, and the only way I can think of is to put all of
>$_REQUEST into $_SESSION, or what else do I do? Stumped.

Why are you using CLI PHP invoked from a form? It seems like a classic
case of trying to drive in nails with a squirrel because you had a squirrel
handy. Use the right tool for the job, which I suspect may involve
include, require, and/or eval and no separate CLI anything.

Gordon L. Burditt

 

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

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