jonass Posted November 10, 2003 Report Posted November 10, 2003 man ir posta forma ar vienu teksta lauku, kas ir skaitlis. dators izveelas skaitli rand(1,5); . kaa ierakstiit mainiigajaa cik reizes ievaditais skalitlis ir sakritis un cik nav?
Aleksejs Posted November 10, 2003 Report Posted November 10, 2003 vareetu buut apmeeram, idejiski shaaadi: <code><font color="#000000"> <font color="#0000CC"><? </font><font color="#006600">function </font><font color="#0000CC">check_checksum</font><font color="#006600">(</font><font color="#0000CC">$a</font><font color="#006600">, </font><font color="#0000CC">$b</font><font color="#006600">, </font><font color="#0000CC">$ab</font><font color="#006600">){ </font><font color="#0000CC">$slepenaa_veertiiba </font><font color="#006600">= </font><font color="#CC0000">"kgahjlghqewlirelourgewiogfregf"</font><font color="#006600">; return (</font><font color="#0000CC">[url=http://lv.php.net/md5]md5[/url]</font><font color="#006600">(</font><font color="#0000CC">$a </font><font color="#006600">. </font><font color="#0000CC">$slepenaa_veertiiba </font><font color="#006600">. </font><font color="#0000CC">[url=http://lv.php.net/session_id]session_id[/url]</font><font color="#006600">() . </font><font color="#0000CC">$b</font><font color="#006600">) == </font><font color="#0000CC">$ab</font><font color="#006600">); } function </font><font color="#0000CC">set_checksum</font><font color="#006600">(</font><font color="#0000CC">$a</font><font color="#006600">, </font><font color="#0000CC">$b</font><font color="#006600">){ </font><font color="#0000CC">$slepenaa_veertiiba </font><font color="#006600">= </font><font color="#CC0000">"kgahjlghqewlirelourgewiogfregf"</font><font color="#006600">; return </font><font color="#0000CC">[url=http://lv.php.net/md5]md5[/url]</font><font color="#006600">(</font><font color="#0000CC">$a </font><font color="#006600">. </font><font color="#0000CC">$slepenaa_veertiiba </font><font color="#006600">. </font><font color="#0000CC">[url=http://lv.php.net/session_id]session_id[/url]</font><font color="#006600">() . </font><font color="#0000CC">$b</font><font color="#006600">); } </font><font color="#0000CC">$pareizie </font><font color="#006600">= </font><font color="#0000CC">$_POST</font><font color="#006600">[</font><font color="#CC0000">'PHP_PAREIZIE'</font><font color="#006600">]; </font><font color="#0000CC">$nepareizie </font><font color="#006600">= </font><font color="#0000CC">$_POST</font><font color="#006600">[</font><font color="#CC0000">'PHP_NEPAREIZIE'</font><font color="#006600">]; </font><font color="#0000CC">$checksumma </font><font color="#006600">= </font><font color="#0000CC">$_POST</font><font color="#006600">[</font><font color="#CC0000">'PHP_SUMMA'</font><font color="#006600">]; if </font><font color="#0000CC">check_checksum</font><font color="#006600">(</font><font color="#0000CC">$pareizie</font><font color="#006600">, </font><font color="#0000CC">$nepareizie</font><font color="#006600">, </font><font color="#0000CC">$checksumma</font><font color="#006600">){ </font><font color="#FF9900">//darbiibas, kas jaaveic tavaa programmaa (tiek izmainiiti mainiigie $pareizie un $nepareizie) </font><font color="#0000CC">$checksumma </font><font color="#006600">= </font><font color="#0000CC">set_checksum</font><font color="#006600">(</font><font color="#0000CC">$pareizie</font><font color="#006600">, </font><font color="#0000CC">$nepareizie</font><font color="#006600">); } else { </font><font color="#0000CC">$pareizie </font><font color="#006600">= </font><font color="#0000CC">0</font><font color="#006600">; </font><font color="#0000CC">$nepareizie </font><font color="#006600">= </font><font color="#0000CC">0</font><font color="#006600">; </font><font color="#0000CC">$checksumma </font><font color="#006600">= </font><font color="#0000CC">set_checksum</font><font color="#006600">(</font><font color="#0000CC">$pareizie</font><font color="#006600">, </font><font color="#0000CC">$nepareizie</font><font color="#006600">); } </font><font color="#0000CC">?> </font>... <input type=hidden name=PHP_PAREIZIE value=$pareizie> <input type=hidden name=PHP_NEPAREIZIE value=$nepareizie> <input type=hidden name=PHP_SUMMA value=$checksumma> ... </font> </code>
Recommended Posts