Reply to Re: Problem with simple PHP login Script

Your name:

Reply:


Posted by Chung Leong on 03/24/06 03:30

carmstrong@cbamedia.com wrote:
> I'm new to PHP and I'm trying to write up a simple PHP login page
> script to authenticate users from a flat file. I've managed to make
> most of it work, except that it only accepts the last user on the
> user/password file, and I'm not sure why. (I.e. the user.txt file is:

It's probably because the text file was created in Windows, where the
line separator is \r\n. When you do the explode on \n, all the elements
except the last will have a \r attached at the end, thus not matching
what was entered.

Use trim() on $username should fix the problem.

[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

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