Reply to Problem resetting sessions with only one button click

Your name:

Reply:


Posted by Ian Davies on 06/21/06 19:57

Hello
I am struggling for a solution to clear some fields on my webpage that takes
their values from some sessions
My solution below works when the button is clicked twice. I sort of know why
I have to click it twice to do the job (the first submit resets the sessions
but this it too late to change the field values, which requires another
submit to pick up the new session values). Problem is I cant think how to
accomplish the resetting of the fields to nothing with one click

Code so far(below)
**********************************
<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF'];
?>">
<input name="Submit" type="submit" value=" Clear ">

<?php
if(isset($_POST['Submit'])){
$_SESSION['savedcomm']='';
$_SESSION['pupilfield']='';
$_SESSION['gender']='';
}
?>

</form>
****************************

Help greatly appreciated
Ian

[Back to original 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

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