Re: QuickForm Question

From: Date: Wed, 29 Oct 2003 10:47:19 +0000
Subject: Re: QuickForm Question
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8672@lists.php.net to get a copy of this message
James 'Chip' Kaufman wrote:
On Tuesday 28 October 2003 11:13, Jeroen Houben wrote:
James 'Chip' Kaufman wrote:
Thanks for the responses. Of course, three minutes after I sent the message, I saw this in element.php: // constant values override both default and submitted ones // default values are overriden by submitted Is there a downside to doing "$_POST=array();" prior to instantiating the object?
     
well I don't think you can. $_POST is a "superglobal" which is read-only. Surely your problem could be solved somewhere else in your code. HTH Jeroen
Amazingly enough, I *can* clear the $_POST array and it solves my problem. If it is not a clean approach, I will try something else. Okay $_POST is *not* read only (thanks Andreas).
Well I guess you could clear the $_POST array if it works fine for you. What I would do in your case though (if I understand correctly what you're trying to do) is something like this: //page1.php $form = new HTML_QuickForm(); // make it point to itself - not page 2 if ($form->validate()) { header("location: page2.php"); exit; } else { form->display(); } this way you won't have any variable cluttering. Jeroen

« previous php.pear.general (#8672) next »