1) Cum as putea sa creez o optiunea pentru upload fisiere?
2) Ce imbunatatiri credeti ca ar trebui sa fac la acest script, genereaza un numar random de la 1 la 1000 si o parola random(e facut ca testing, ca sa invat mai bine ) :
Cod: Selectaţi tot
<?php
function GetRandomNumber( )
{
$Number = rand( 1, 1000 );
return $Number;
}
function GetRandomPassword( )
{
$Chars = 'AaBdejwEprlmaj12058xnJmwpXP';
$SizeChars = strlen( $Chars );
$Hash=NULL;
for( $x=0; $x < $SizeChars; $x++ )
{
$Hash .= substr( $Chars, rand( 0, $SizeChars ), 1 );
}
return $Hash;
}
$Text1 = GetRandomNumber();
$Text2 = GetRandomPassword();
echo "<code>Random number from 1 to 1000</code>:</br><u> <b> $Text1 </b> </u>";
echo "<p>Random password generated: <b> <u> $Text2 </u> </b>";
echo "<p> <b>Info</b>: Pentru o noua generare random da-ti referesh a pagina!";
echo "<p>URL sursa codului: <u>http://lordandreas.esy.es/RandomSursa.txt</u>"
?>
Si 3) Cunoasteti vreo carte buna de php pentru incepatori ?