You are here: Re: retaiing values when resubmitting a page « PHP SQL « IT news, forums, messages
Re: retaiing values when resubmitting a page

Posted by Ian Davies on 05/30/06 01:47

thanks
I found a solution. posted below incase anyone else is interested

at top of page
session_start();
$_SESSION['mytextbox'] = trim($_POST['mytextbox']);
$_SESSION['myradiobutton'] = trim($_POST['myradiobutton']);

for the textbox
input name="mytextbox" type="text" value="<?php echo
$_SESSION['mytextbox'];?>"

for the radiobutton
input <?php if (!(strcmp($_SESSION['myradiobutton'],"1"))) {echo "CHECKED";}
?> name="myradiobutton" type="radio" value="yourcheckedvaluehere"

ian


"dimo414" <dimo414@gmail.com> wrote in message
news:1148936810.408821.112400@j33g2000cwa.googlegroups.com...
> inside the tag for the textarea, the value attribute should be set to a
> snippet of php which echo's (or prints) the value of the posted
> variables. If nothing has been submitted, then nothing will be echoed,
> and the box will appear empty. if something was submitted, it will be
> echoed back into the box. A similar idea applies to radio and
> checkboxes, but it's SLIGHTLY more dificult because you have to
> determine (using if conditionals) which button it should be set to.
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация