RE: [PEAR] FormBuilder submit button keeping record open?

From: Date: Thu, 13 Oct 2005 13:24:09 +0000
Subject: RE: [PEAR] FormBuilder submit button keeping record open?
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21443@lists.php.net to get a copy of this message
Man, you are a genius! Or I'm retarded... probably both. But that was exactly what I needed. Never even though of using the headers command... shnikes! Thanks a bunch! Zane -----Original Message----- From: Justin Patrin [mailto:papercrane@gmail.com] Sent: Wednesday, October 12, 2005 4:14 PM To: Wright Zane A A1C 30 IS/DOMM Cc: pear-general@lists.php.net Subject: Re: [PEAR] FormBuilder submit button keeping record open? On 10/12/05, Wright Zane A A1C 30 IS/DOMM <Zane.Wright@langley.af.mil> wrote: > Hey all, > > > > Have a situation here... I am working on migrating to the web from a > bunch of MS Access forms. I have about everything done but one small > section. In Access I had originally a "Save" and a "Save and Close" > button. I am looking to duplicate the Save button, where it saves the > record and yet still keeps it open for use by the user. > > > > I have been using the instructions from the PHP Developers Conference > pdf file and have gotten quite a bit of use out of it. My code I use is > as follows: (not pasted from code, that is on a different network, so > please bear with me) > > > > $table = $_GET['table']; //get the table for auto generation > > $do = DB_DataObject::factory($table); > > If(isset($_GET['id'])) { > > $do->get($_GET['id']); //pull the proper record if its > already set. > > } > > > > $builder =& DB_DataObject_FormBuilder::create($do); > > $form = $builder->getForm($_SERVER['REQUEST_URI']); > > > > //the problems start here: > > If($form->validate()) { > > $res = $form->process(array($builder, 'processForm'), > false); > header('Location: '.$_SERVER['REQUEST_URI'].'&id='.$do->id); Or something similar. > > } else { > > $form->display(); > > } > > > > If anybody can help me out I'd greatly appreciate it! Thanks, > > > > Zane > > > -- Justin Patrin

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