You are here: Re: Using SESSION in PHP « All PHP « IT news, forums, messages
Re: Using SESSION in PHP

Posted by J.O. Aho on 01/07/08 05:43

jcage@lycos.com wrote:
> Hello,
>
> I have a form that uses a basic passphrase to ensure an employee user
> is who they say they are. One field uses 'text' as the input type and
> the other uses 'password'. When a query has been run, a user can
> click the browser back button and the name is still there intact but
> the password field is blank. My question is, what would the 'SESSION'
> code look like that would allow a user to click their back button
> where the 'userpass' field holds the original passphrase in the same
> manner the browser holds the user name within the text field?

Using Session will require that the user is logged in before the password will
be there.

--- page that gets the username/password ---
session_start();
$_SESSION['password']=$_POST['userpass']; // we assume you use default post
--- eoe ---

--- the login form ---
<td>User Password:</td><td align="left"><input type="password"
name="userpass" size="29" maxlength="30" value="<?php echo
$_SESSION['password']; ?>"></td></tr>
--- eoe ---

If you want the password to be stored between sessions, then you have to use
cookies, which means you store the password in plain text on the client computer.

I suggest you talk with the system administration and ask if it would be
possible to upgrade the browsers to a more modern one, visit mozilla.org if
you want a browser that can store both the username and password and on top of
all encrypts the password it stores.

--

//Aho

 

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

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