Cadastro estruturado transformado em funções, pra agilizar a vida de quem programa...
<?php
function write_account($loc,$login,$senha,$nome,$email){
$name = $loc.$login; //"C:\\Server\\Common\\ImportUser\\"
$file = fopen($name, 'wt');
$escreve = fwrite($file, "$login\n");
$escreve = fwrite($file, "$senha\n");
$escreve = fwrite($file, "$nome\n");
$escreve = fwrite($file, "1234\n");
$escreve = fwrite($file, "1234\n");
$escreve = fwrite($file, "$email\n");
$escreve = fwrite($file, "123456789\n");
$escreve = fwrite($file, "abcdefghij\n");
$escreve = fwrite($file, "0\n");
fclose($file);
}
//write_account("C:\\Server\\Common\\ImportUser\\",'ttxxs','ttxxs','ttxxs','
[email protected]');
function Str_Check($string){
if(!@preg_match('/^[a-zA-Z0-9]+$/',$string))
{
echo '<script type="text/javascript">
alert("Seu login so pode ter caracteres¸a-z,A-Z ");
window.location="/";
</script>';
}
}
//Str_Check('[**S@@A');
function Get_Folder($userid){
$initial=substr($userid,0,1);
if (@preg_match('/^[a-zA-Z]+$/',$initial))
{$initial=strtoupper($initial);}
else
{$initial="etc";}
return $initial;
}
//echo Get_Folder('[**X]');
function Account_Check($loc, $inicial, $userid){
if(file_exists($loc ."/". $initial ."/". $userid))
{
exit("Essa conta já existe");
}
}
//Account_Check('C:\\Server\\Common\\ImportUser\\', 'M', 'MANDA');
?>