Re: Re: header( 'refresh' ), form data, and IE
| From: | Tijnema | Date: | Wed, 25 Jul 2007 13:26:07 +0000 |
| Subject: | Re: Re: header( 'refresh' ), form data, and IE | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-259509@lists.php.net to get a copy of this message | ||
On 7/25/07, Daniel Brown <parasane@gmail.com> wrote:
On 7/24/07, Daniel Kasak <dkasak@nusconsulting.com.au> wrote: On Tue, 2007-07-24 at 08:13 -0400, Daniel Brown wrote:You Dans driving me insine with all those dans :P Tijnema -- Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.infoI've completely changed the way I was doing this now. Initially I implemented lots of checks for NULL values, as Dan[2] recommended, and this worked well apart from in the case of text areas. These broke things completely. I've now decided to shove all form data into session globals, and just refresh with a 'load_previous' flag in the URL. I my form constructor sees this flag, it populates things from session globals. Otherwise it resets the session globals with defaults. This seems to be the best solution ( ie the only one that's worked completely so far ). Thank you, both of you. Long live Dans! -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: dkasak@nusconsulting.com.au website: http://www.nusconsulting.com.au Viva Danielism! -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107Hello, Dans!Dan K., is there any reason the validation can't reside within thesame script as the form, then forward on success? A very simple example: <? if($_POST) {// Check to ensure that your variables are all correct, // then use header("Location: successful-target.php?var1=a&var2=b"); // And then, on forwarding, remember to exit;} ?> <FORM METHOD="POST" ACTION="<?=$_SERVER['PHP_SELF'];?>"> <INPUT TYPE="TEXT" NAME="var1" VALUE="<?=$_POST['var1'];?>"><BR /> <INPUT TYPE="TEXT" NAME="var2" VALUE="<?=$_POST['var2'];?>"><BR /> <INPUT TYPE="SUBMIT" VALUE="GO!"> </FORM>Since the user will start with a blank form, and the $_POST valueswon't already be set, the values in the form will be blank on the initial page load, but for unsuccessful attempts, they'll be populated with the correct data.~ Dan^[3]