Re: formbuilder: where do you put a redirect statement to redirect you to another page after processing?
| From: | Justin Patrin | Date: | Wed, 05 Jan 2005 21:08:32 +0000 |
| Subject: | Re: formbuilder: where do you put a redirect statement to redirect you to another page after processing? | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16700@lists.php.net to get a copy of this message | ||
On Wed, 5 Jan 2005 11:55:03 -0800 (PST), l Burnerheimerton
<lburnerheimerton@yahoo.com> wrote:
> Justin Patrin <papercrane@gmail.com> wrote:
>
>
> On Wed, 5 Jan 2005 11:40:33 -0800 (PST), l Burnerheimerton
> wrote:
> > Thank you for your help so far - sincerely. I think I might just be out of
> > my league here. You've done a great job helping to build FormBuilder and I
> > know you think there is great documentation, but there are aren't enough
> > examples for the average programmer like me to find my way through it.
>
> I agree.
>
> >
> > The person who gave the presentation at the PHP conference indicated it
> will
> > save development time 3 fold. That's probably true if you have several
> > weeks or more to devote solely to learning it. I think once it people
> start
> > to use it more and more there will be more examples. Unfortunately, I am
> in
> > a time crunch. I really hoped to be able to use it and spread the good
> word
> > but, having tried to use it and finding some success, I find I am spending
> > way too much time researching solutions and this newsgroup is the only
> place
> > I can get help.
>
> It's more understanding how OO works and the design patterns behind
> it. I know it can be daunting. We will have more and better examples
> eventually. Right now we're trying to get everything working and done
> code-wise for a stable release.
>
> Any reading recommendations to get me up to speed? Thanks
>
Not really, sorry. I've kind of gleaned all of my knowledge about it.
Perhaps someone else has some recommendations? You could always read
OO tutorials. In fact, I wrote one (for Java, but the OO principals
are the same).
http://www.reversefold.com/java/
It doesn't get into the design patterns, but you can search for them.
Factories
Observers
Decorators
etc.
>
> >
> > I have to cut my losses and go back to quickforms which I know better for
> > lack of time.
>
> Please don't. It sounds like you're having very small problems. The
> solutions I have given you will work. And here they are again. Sorry
> for being snippy, but it seems I keep saying the same thing over and
> over.
>
> Check my FAQ entry for how to redirect.
> http://opensource.21st.de/tiki-view_faq.php?faqId=1#q4
>
> For the value of the field, you must set it in the DO or set the value
> using setDefaults in postGenerateForm.
>
> function preGenerateForm() {
> $this->preDefElements...etc.
>
> $this->proj_ID = $_REQUEST['pid'];//or whatever the names are
> }
>
> THAT WORKED _ HURRAY! I don't remember seeing that before in your prior
> posts, but regardless, it worked and I thanks you. That little problem had
> stumped me and delayed for for a day. But now I am back on track. Thanks
>
>
> OR
>
> function postGenerateForm(&$form) {
> $form->setDefaults(array('proj_ID' => $_REQUEST['pid']));//or
> whatever the names are
> }
>
> >
> >
> >
> >
> >
> > Justin Patrin wrote:
> > Or use an if(). Please think about things before posting.
> >
> >
> > On Wed, 5 Jan 2005 11:11:46 -0800, Justin Patrin wrote:
> > > echo 'stop here';
> > > exit;
> > >
> > > On Wed, 5 Jan 2005 11:10:45 -0800 (PST), l Burnerheimerton
> > > wrote:
> > > >
> > > >
> > > > Justin Patrin wrote:
> > > >
> > > >
> > > > On Wed, 5 Jan 2005 11:00:38 -0800 (PST), l Burnerheimerton
> > > > wrote:
> > > > > I tried it with just using quickform and it had the same problem. I
> > need
> > > > to
> > > > > add an html element in the formbuilder - which I asked about in an
> > earlier
> > > > > posting and you'll probably see that one soon if you haven't
> > > > > lready
> -
> > > > > thanks!
> > > >
> > > > What does an html element have to do with a redirect? Just output the
> > > > redirect. You don't need to output the form if you're redirecting.
> > > >
> > > >
> > > > How do you stop the outputting of the form?
> > > >
> > > >
> > > > >
> > > > > Justin Patrin wrote:
> > > > > On Wed, 5 Jan 2005 07:55:41 -0800 (PST), l Burnerheimerton
> > > > > wrote:
> > > > > > I've tried in the form that calls the dataobject page, in
> preprocess
> > and
> > > > > postprocess functions and none work. They all throw the error
> "Cannot
> > > > modify
> > > > > header information - headers already sent by..."
> > > > > >
> > > > > > My page has some html in it before the php code for formbuilder..
> If
> > I
> > > > take
> > > > > that out it works but I need that in to format the page properly.
> > > > > >
> > > > > > If I can't have that in, I might just scrap using FormBuilder.
> > > > >
> > > > > Grrr. header() is one way to redirect. If you must output before the
> > > > > validation and processing, use a meta refresh or javascript to
> > > > > redirect. Redirecting has *nothing* to do with FormBuilder.
> > > > >
> > > > > Try this:
> > > > > function redirect($url) {
> > > > > if ((!stristr($_SERVER['HTTP_USER_AGENT'], 'MSIE') ||
> > > > > !stristr($_SERVER['HTTP_USER_AGENT'], 'Mac'))
> > > > > && !headers_sent()) {
> > > > > header('Location: '.$url);
> > > > > }
> > > > > echo '
> > > > >
> > > > >
> > > > >
> > > > > This page has moved to a new location.
> > > > > ';
> > > > > }
> > > > >
> > > > >
> > > > > >
> > > > > > Thanks for any ideas
> > > > > >
> > > > >
> > > >
> > > > --
> > > > Justin Patrin
> > > >
> > > >
> > > > ________________________________
> > > > Do you Yahoo!?
> > > > Meet the all-new My Yahoo! â€" Try it today!
> > > >
> > > >
> > >
> > >
> > > --
> > > Justin Patrin
> > >
> >
> >
>
> --
> Justin Patrin
>
>
--
Justin Patrin