- Oct 10, 1999
- 9,286
- 15
- 81
What I want to do is find the position (+1) of the first vowel in a users name and then take that output and use it in a password. What I have is this, but it friggen sucks... I am lost now.. heading down the wrong road and I need a bit help:
Thanks in advance,
SHUX
function firstvowel(){
include('admin_connect.php');
$query=("SELECT first_name FROM users WHERE username='".$_SESSION['username']."'");
$result = $db_object->query($query);
if (DB::isError($result)) {
die($result->getMessage());
}
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
$firstname=$row['first_name'];
$firstname=trim($firstname);
$countvowel=strpos($firstname, (eregi('^[aeiou]$', $firstname)))+1;
return $countvowel;
}
Thanks in advance,
SHUX