You are here: Re: Newbie question: how to save user id on user's computer « PHP Programming Language « IT news, forums, messages
Re: Newbie question: how to save user id on user's computer

Posted by ZeldorBlat on 11/02/05 18:35

>It's my understanding that to do this I would write the information to
>a cookie (after he successfully logs in with the option checked).

Yes.

>What I'm not clear on is, how do I get the userid from the cookie into the
>text box on the log-in page? Do I read the cookie when he "hits" the >log-in page and then load the text box before I send out the page?

If the browser sends a cookie, you'll find the value of any cookie
variables in $_COOKIE[]. So grab the value from there (i.e.
$_COOKIE['username']) and use it when you build the HTML for the
textbox:

$username = $_COOKIE['username'];
echo '<input type="text" name="username" value="$username"/>';

 

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

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