Re: formbuilder: where do you put a redirect statement to redirect you to another page after processing?

From: Date: Wed, 05 Jan 2005 19:00:38 +0000
Subject: Re: formbuilder: where do you put a redirect statement to redirect you to another page after processing?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16674@lists.php.net to get a copy of this message
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! Justin Patrin <papercrane@gmail.com> 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 ' location.replace("'.$url.'"); //--> This page has moved to a new location. '; } > > Thanks for any ideas > -- Justin Patrin -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --------------------------------- Do you Yahoo!? Yahoo! Mail - You care about security. So do we.

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