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
[Back to original message]
|