Page 2 of 2

Posted: Mon Jun 26, 2006 1:48 pm
by Todd_Z
Have a structure for the script to return, for example, if the suggested username is taken, then return 0|username_06|username_hi|username_OK|blahblahblah

If it's available just return a 1

Idea for suggesting usernames:

Code: Select all

$ideas = array();

$idea = "{$username}_2006";
if ( ! is_taken( $idea ) )
  $ideas[] = $idea;

$idea = "{$username}_n00b";
if ( ! is_taken( $idea ) )
  $ideas[] = $idea;

echo "0|".implode( '|', $ideas );

Posted: Mon Jun 26, 2006 3:03 pm
by bokehman
Jcart wrote:

Code: Select all

$possibilities = array(
   $username.rand(0,9),
   $username.'_'.$firstname
);
you get the point..
And obviously you you should run these through the DB make sure they are available.