![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 1 Pomógł: 0 Dołączył: 14.08.2008 Ostrzeżenie: (0%) ![]() ![]() |
Witam wszystkich mam problem odnośnie funkcji sprawdzajacej poprawność PESELU a dokładnie to niewiem gdzie ją wklejić by to działało.
KOD FORMULARZA: Kod {<strong>Pesel:</strong><input type=\"text\" name=\"pesel\" size=\"11\" maxlength=\"11\" style=\"position: absolute; left: 180px; background-color: cornsilk; font-style: italic; color: gray\"> funkcja sprawdzania pesel: Kod <?php
function check_pesel($pesel) { if (strlen($pesel) != 11 || !is_numeric($pesel)) return 0; $steps = array(1, 3, 7, 9, 1, 3, 7, 9, 1, 3); for ($x = 0; $x < 10; $x++) { $sum_nb += $steps[$x] * $pesel[$x]; } $sum_m = 10 - $sum_nb % 10; if ($sum_m == 10) $sum_c = 0; else $sum_c = $sum_m; if ($sum_c == $pesel[10]) return 1; return 0; } ?> Ten post edytował szerszenn 14.08.2008, 10:22:35 |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 14.08.2025 - 06:16 |