ale jak już index.php?costam=formularzquick.php
to:
-> jak cały formularz ok, to przekierowuje do index.php i nic :: -
-> jak sąwszystkie dane, nawet złe, to przepuszcza do index.php :: -
-> dopóki nie wypełnie wszystkich pól, to wyskakują okienka z komunikatem, czyli ok :: +
<?php require_once 'HTML/QuickForm.php'; $form = new HTML_QuickForm('firstForm'); $form->setDefaults( $form->addElement('header', null, 'Zgloszenie nowego uzytkownika'); $form->addElement('text', 'login', 'Login:', null); 12, 'maxlength' => 10)); 'maxlength' => 10)); $form->addElement('text', 'name', 'Imie i nazwisko:', null); $form->addElement('text', 'mail', 'E-mail:', null); $form->addElement('text', 'age', 'Wiek:', null); $form->addElement('text', 'phone', 'Telefon:', null); $form->addElement('select', 'prenumerata', 'Czy prenumerujesz<br /> Magazyn $form->addElement('submit', null, 'Wyslij'); $form->addRule($name, $msg, $options); $form->addRule('login', 'Niepoprawny format pola Login.', 'regex', '/^[-_a-z0-9]+$/i'); $form->addRule('login', 'Wypelnij pole.','required'); $form->addRule('password', 'Podaj haslo.', 'required'); $form->addRule('password', 'Haslo musi miec 5-10 znakow.', 'rangelength', $form->addRule('repeat', 'Powtorz podane haslo.', 'required'); samo.', 'compare'); $form->addRule('mail', 'Podaj adres e-mail', 'required', null, 'client'); $form->addRule('mail', 'Niepoprawny format pola adresu e-mail.', 'email'); $form->addRule('name', 'Prosze podac imie i nazwisko', 'required', null, 'client'); $form->addRule('age', 'Podaj wiek.', 'required', null, 'client'); $form->addRule('age', 'To nie moze byc twoj wiek.', 'numeric'); $form->addRule('phone', 'Niepoprawny format', 'numeric'); if ($form->validate()) { '<br />'; />'; />'; />'; '<br />'; exit; } $form->display(); ?>