You are here: Re: Space detection in text input form « All PHP « IT news, forums, messages
Re: Space detection in text input form

Posted by Veikko Mδkinen on 06/03/05 18:23

Chris B wrote:
> I am trying to create a "foolproof" login.
>
> Basically people can type their name in with no password or
> registration, this is done on trust and so that the site can keep track
> of them.
> All the scripts to hold this in place work perfectly however I'm
> struggling with the handling of an input with one or more text.
>
>
> The sql type of username is varchar(64) so what I'm trying to work out
> is how to say "if there is one or more space in the input, use their
> ip", which I have already worked out and is stored in $ip
>
> I've tried
> if ($username == " ") $username = "Mr or Miss ".$ip;
>

RER! (= "Regular Expressions Rock!", just made it up :)

if (preg_match("/\s/", $username)) ...


-veikko

--
veikko
mail@ .com
makinen

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация