load($fname); $elems = $doc->getElementsByTagName("user"); $size = $elems->length; // Get the users tag as a node $users = $doc->getElementsByTagName("users"); // returns list of users tags $container = $users->item(0); // should point out the users tag // searching for this login // scanning the array of entries $already = false; if($size > 0) { foreach($elems as $user) { if($user->getAttribute("login") == $ulogin) { $already = true; echo "
$ulogin already used, try another name...
"; $filename ="login-already.php?ulogin=$ulogin"; break; } } } if(! $already) { $x = $doc->createElement("user"); $x->setAttribute("login", $ulogin); $x->setAttribute("password", MD5($upass)); $container->appendChild($x); $doc->save($fname); echo "

You have created this user:
"; echo $ulogin . "
"; echo $upass . "
"; } $size += 1; echo "
The database holds $size users.
"; ?>

You are now registered.

method="post" target="_parent">