You are here: Re: When is $_POST set and unset? « All PHP « IT news, forums, messages
Re: When is $_POST set and unset?

Posted by kenoli on 05/17/07 15:26

Thanks. What triggered all of this was the need to pass various
values between scripts to various variables in the receiving script,
some connected naturally to a form field and some not. Sometimes they
are the result of a database query or sometimes the result of an
operator like a switch statement. There are obviously various ways to
do this, e.g. "get" pairs in a URL, session variables, name value
pairs in a hidden field, And then the receiving script needs a
trigger to know which value to use. I'm seeing the significant
variety of ways php provides to accomplish both these functions.

As I'm coding, things seem to start out by getting complicated fast
and then collapsing into more simplified structures as I start to see
the patterns. One thing that seems particularly valuable is being
able to see the symetries that can be collapsed into triggered
choices.

--Kenoli


On May 16, 11:20 am, "J.O. Aho" <u...@example.net> wrote:
> kenoli wrote:
> > I have a script that submits form data via a "post" method to another
> > script. I have an href link in the destination script that links back
> > to itself for processing form data on that page with some "get" data
> > appended to the URL. I noticed that after clicking on that link and
> > sending the action back to itself, a check of isset($_POST) returns
> > true while displaying the content of $_POST displays an empty array.
> > I had expected isset($_POST) to return false, thinking the script
> > would unset the $_POST array when the <a> link sent it back to
> > itself. Instead, it leaves $_POST set but empty.
>
> if you have a <input type="text" name="something" value=""> then test against
> the something cell in the $_POST: isset($_POST['something'])
>
> --
>
> //Aho

 

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

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