You are here: Re: Problem resetting sessions with only one button click « All PHP « IT news, forums, messages
Re: Problem resetting sessions with only one button click

Posted by Tommy Gildseth on 06/21/06 20:06

Ian Davies wrote:
> 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
>
>

Simply rearange the order of the form, and the resetting of the session
variables, so that the resetting of session variables comes before the
form in the code?

--
Tommy Gildseth
http://design.twobarks.com/

 

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

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