laacz Posted February 19, 2003 Report Share Posted February 19, 2003 vb. palīdzēs phpinfo salīdzināšana un/vai my.cnf salīdzinājums (esp.parameter-quoting)? Viss ir identisks :) Link to comment Share on other sites More sharing options...
Venom Posted February 19, 2003 Author Report Share Posted February 19, 2003 (edited) Tad vienīgā atšķirība būtu \r\n Win32 un \n Linuxiem :) nostriplseshoja manus slashus :( Edited February 19, 2003 by Venom Link to comment Share on other sites More sharing options...
laacz Posted February 19, 2003 Report Share Posted February 19, 2003 Tad vienīgā atšķirība būtu rn Win32 un n Linuxiem :) Arī tur nav problēma :) Link to comment Share on other sites More sharing options...
laacz Posted February 19, 2003 Report Share Posted February 19, 2003 <code><font color="#000000"> <font color="#0000CC"><? </font><font color="#FF9900">//srand just once please </font><font color="#0000CC">[url=http://lv.php.net/srand]srand[/url]</font><font color="#006600">((double)</font><font color="#0000CC">[url=http://lv.php.net/microtime]microtime[/url]</font><font color="#006600">()*</font><font color="#0000CC">1000000</font><font color="#006600">); </font><font color="#FF9900">//return a (pseudo) random string of specified length, default=114 </font><font color="#006600">function </font><font color="#0000CC">RandomString</font><font color="#006600">( </font><font color="#0000CC">$passwordLength</font><font color="#006600">=</font><font color="#0000CC">114</font><font color="#006600">) { </font><font color="#0000CC">$password </font><font color="#006600">= </font><font color="#CC0000">""</font><font color="#006600">; for (</font><font color="#0000CC">$index </font><font color="#006600">= </font><font color="#0000CC">1</font><font color="#006600">; </font><font color="#0000CC">$index </font><font color="#006600"><= </font><font color="#0000CC">$passwordLength</font><font color="#006600">; </font><font color="#0000CC">$index</font><font color="#006600">++) { </font><font color="#FF9900">// Pick random number between 1 and 62 </font><font color="#0000CC">$randomNumber </font><font color="#006600">= </font><font color="#0000CC">[url=http://lv.php.net/rand]rand[/url]</font><font color="#006600">(</font><font color="#0000CC">1</font><font color="#006600">, </font><font color="#0000CC">62</font><font color="#006600">); </font><font color="#FF9900">// Select random character based on mapping. </font><font color="#006600">if (</font><font color="#0000CC">$randomNumber </font><font color="#006600">< </font><font color="#0000CC">11</font><font color="#006600">) </font><font color="#0000CC">$password </font><font color="#006600">.= </font><font color="#0000CC">[url=http://lv.php.net/chr]chr[/url]</font><font color="#006600">(</font><font color="#0000CC">$randomNumber </font><font color="#006600">+ </font><font color="#0000CC">48 </font><font color="#006600">- </font><font color="#0000CC">1</font><font color="#006600">); </font><font color="#FF9900">// [ 1,10] => [0,9] </font><font color="#006600">else if (</font><font color="#0000CC">$randomNumber </font><font color="#006600">< </font><font color="#0000CC">37</font><font color="#006600">) </font><font color="#0000CC">$password </font><font color="#006600">.= </font><font color="#0000CC">[url=http://lv.php.net/chr]chr[/url]</font><font color="#006600">(</font><font color="#0000CC">$randomNumber </font><font color="#006600">+ </font><font color="#0000CC">65 </font><font color="#006600">- </font><font color="#0000CC">10</font><font color="#006600">); </font><font color="#FF9900">// [11,36] => [A,Z] </font><font color="#006600">else </font><font color="#0000CC">$password </font><font color="#006600">.= </font><font color="#0000CC">[url=http://lv.php.net/chr]chr[/url]</font><font color="#006600">(</font><font color="#0000CC">$randomNumber </font><font color="#006600">+ </font><font color="#0000CC">97 </font><font color="#006600">- </font><font color="#0000CC">36</font><font color="#006600">); </font><font color="#FF9900">// [37,62] => [a,z] </font><font color="#006600">} return </font><font color="#0000CC">$password</font><font color="#006600">; } </font><font color="#FF9900">//Returns randomness as string </font><font color="#006600">function </font><font color="#0000CC">NewSessionIdentifier</font><font color="#006600">() { </font><font color="#FF9900">//MD5 it (always 32 bytes long) </font><font color="#006600">return (string) </font><font color="#0000CC">[url=http://lv.php.net/md5]md5[/url]</font><font color="#006600">(</font><font color="#0000CC">uniqid </font><font color="#006600">(</font><font color="#0000CC">RandomString</font><font color="#006600">(</font><font color="#0000CC">114</font><font color="#006600">),</font><font color="#0000CC">1 </font><font color="#006600">)); } </font><font color="#0000CC">?> </font> </font> </code> Link to comment Share on other sites More sharing options...
Venom Posted February 19, 2003 Author Report Share Posted February 19, 2003 Homera Simpsona kliedziens: Juhū, juhū! Tikai vēl liekos breikus no koda sākuma un beigām notrimot... (mazliet sāls jābūt :)) Link to comment Share on other sites More sharing options...
Venom Posted February 19, 2003 Author Report Share Posted February 19, 2003 2laacz: norādē uz [code ] izmantošanu redzams opbligāti. o4epjatka. Link to comment Share on other sites More sharing options...
laacz Posted February 19, 2003 Report Share Posted February 19, 2003 2laacz: norādē uz [code ] izmantošanu redzams opbligāti. o4epjatka. Tnx, fixed. Link to comment Share on other sites More sharing options...
Recommended Posts