Reply to Re: [PHP] Interesting, yet goofy behavior

Your name:

Reply:


Posted by Rasmus Lerdorf on 04/06/05 22:44

Jay Blanchard wrote:
> Let's say I have a form and the action is thus;
>
> <form name=\"managebatch\" action=\"" . basename($PHP_SELF) .
> "?bid=edit\" method=\"POST\">\n";
>
> Note the 'bid' attribute. Now, I have a case statement in which stuff
> takes place since the form has called it because of the 'bid' attribute.
> Before I break from the case I do this;
>
> unset($_GET['bid']);
>
> SIDEBAR: You should all note that I ma editing someone else's code.
> Someone who did not bother to comment their code. [ed note: Yes, they
> work for the same company, but are not in the department, yet management
> says that I have to support their code. I asked if we could at least
> teach them commenting and revision control. They looked at me as if I
> was a space alien]. Someone who believes that all forms should use
> $PHP_SELF (because whatever book they have showed them this, so
> therefore it must be good for everything).
>
> The URL comes back and the 'bid' attribute is still there. Is this to be
> expected? If so, do you have any advice (other than copious amounts of
> alcohol) for dealing with this?

What do you mean the URL comes back?

foo.php?bid=edit

Is the request. In foo.php at some point you unset $_GET['bid'], which
is a silly thing to do, but whatever, and then what are you expecting to
happen?

-Rasmus

[Back to original 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

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