On Monday 27 January 2003 11:46 am, 1LT John W. Holmes wrote: > > I've managed to get Windows IE to pick up on most of my $_SESSION > > variables > > > once a user clicks the 'Back' button using the following code in the base > > form: > > > > 'value=<?php if(!empty($_SESSION['rfname'])) echo $_SESSION['rfname']; > > ?>' > > > > However, when I try this approach for a muliple SELECT dropdown box that > > is > > > loaded by a 'require' statement, it doesn't pass the info. I've tried to > > isolate the individual components: > > > > <?php require("dobdod.fdd"); > > > > if(!empty($_PST['bday'])) echo $_POST['bday']; > > if(!empty($_POST['bmonth'])) echo $_POST['bmonth']; > > if(!empty($_POST['birth'])) echo $_POST['birth']; > > > > if(!empty($_POST['dday'])) echo $_POST['dday']; > > if(!empty($_POST['dmonth'])) echo $_POST['dmonth']; > > if(!empty($_POST['death'])) echo $_POST['death']; > > ?> > > > > Btw, the base form calls another form, which displays an error message. > > Once > > > the 'Back' button is clicked, the base form reappears. [I've also tried > > putting a <?php . . . ?> around each if(!empty . . .); statement above > > with > > > same result.] > > > > Any ideas what I'm doing wrong? I've been at this one for a couple of > > weeks, > > > and nothing seems top work. Is it possible to pass the info back to the > > base > > > form? > > SELECT boxes work differently from text boxes. To set a select box to a > certain value, you need to put SELECTED into the option tag, like: > > <option value="some_value" SELECTED>Text Value</option> > > So, you need to create some loop or test to see where you should put the > SELECTED. For short lists, doing something like: > > <option value="some_value" <? if(isset($_SESSION['select']) && > $_SESSION['select'] == 'some_value') { echo " SELECTED"; }?>>Text > Value</option> > > For larger lists, it's easier to put the values into an array and make a > function that loops through and test each value for where to put the > SELECTED text. > > Hope that helps. > > ---John Holmes...
Thanks John, Great to get your excellent advice again. I've been off-list for a few months. Never thought of doing the extra coding IN the require file! That's probably why it didn't work. I tried to pick up the values from $_POST (as above). In Linux, it works: (i.e. I can pick them up, display them, and manipulate them using the code above), but in IE something like $_POST['bday'] never shows up. Any idea why there's such a difference between OS behavior? Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php