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 19:11:46 +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-16681@lists.php.net to get a copy of this message | ||
echo 'stop here';
exit;
On Wed, 5 Jan 2005 11:10:45 -0800 (PST), l Burnerheimerton
<lburnerheimerton@yahoo.com> wrote:
>
>
> Justin Patrin <papercrane@gmail.com> 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! !DSPAM:41dc3df414851456186055!
>
>
--
Justin Patrin