1. Список говнокодов пользователя Mitusbka

    Всего: 2

  2. PHP / Говнокод #2478

    +162.1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    $cities_id=array(1,2,3,4,5,6);
     $cities_name=array("MSK","SPB","NN","KZ","NOV","UFA");
     
     GHTML::Run(array("html_autoinsert_on"=>0,"html_method"=>"_POST"));
    
     print GHTML::Link("/test.php",null,GHTML::Link("/test.php","style='font-weight:bold;font-size:20px;'")->Html("[Главная]"))->Html("[Главная]");
     print " ";
     print GHTML::Link("/test.php?act=reg",null,GHTML::Link("/test.php?act=reg","style='font-weight:bold;font-size:20px;'")->Html("[Регистрация]"))->Html("[Регистрация]");
      
      
     print GHTML::Form("POST","")
     ->HTML(
         GHTML::Input("name","text","Имя пользователя",null,true)->Html(),
         "<br>",
         GHTML::Input("pass1","password","Пароль")->Html(),
    	 "<br>",
         GHTML::Input("pass2","password","Пароль ещё раз")->Html(),
    	 "<br>",
         GHTML::Select("city")->Html(
               GHTML::Option("")->Html("Выберите город"),
               GHTML::Option($cities_id,$_POST['city'])->Html($cities_name)
         ),
    	 "<br>",
    	 GHTML::CheckBoxList("che_cities[]",$cities_id,null,$_POST['che_cities'])->Html($cities_name),
         "<br>",
    	 GHTML::RadioList("r_cities[]",$cities_id,null,$_POST['r_cities'])->Html($cities_name),
    	 "<br>",
         GHTML::Textarea("resume",50,9,null,true)->Html("Ненмого о себе"),
    	 "<br>",	 
    	 GHTML::Input("","submit","Жми!")->Html()
     );
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////
    
    
    <a href='/test.php'  />[Главная]</a> <a href='/test.php?act=reg' style='font-weight:bold;font-size:20px;' />[Регистрация]</a><form method='POST' action='' /><input type='text' name='name' value='Имя пользователя'  /><br><input type='password' name='pass1' value='Пароль'  /><br><input type='password' name='pass2' value='Пароль ещё раз'  /><br><select name='city'  /><option value=''  />Выберите город</option><option value='6'  />MSK</option><option value='5'  />SPB</option><option value='4'  />NN</option><option value='3'  />KZ</option><option value='2'  />NOV</option><option value='1'  />UFA</option></select><br><input type='checkbox' name='che_cities[]' value='6'  />MSK<br /><input type='checkbox' name='che_cities[]' value='5'  />SPB<br /><input type='checkbox' name='che_cities[]' value='4'  />NN<br /><input type='checkbox' name='che_cities[]' value='3'  />KZ<br /><input type='checkbox' name='che_cities[]' value='2'  />NOV<br /><input type='checkbox' name='che_cities[]' value='1'  />UFA<br /><br><input type='radio' name='r_cities[]' value='6'  />MSK<br /><input type='radio' name='r_cities[]' value='5'  />SPB<br /><input type='radio' name='r_cities[]' value='4'  />NN<br /><input type='radio' name='r_cities[]' value='3'  />KZ<br /><input type='radio' name='r_cities[]' value='2'  />NOV<br /><input type='radio' name='r_cities[]' value='1'  />UFA<br /><br><textarea name='resume' cols='50' rows='9'  />Ненмого о себе</textarea><br><input type='submit' name='' value='Жми!'  /></form>

    хорошо что php гиппертекстовый ;)

    Mitusbka, 24 Января 2010

    Комментарии (16)
  3. PHP / Говнокод #2098

    +160.4

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    <?php
     $form = new Validator;
     $form
         ->newString(Request::get('nickname'));
         ->addRules(
             new FW\Rules\NotEmpty(),
             new FW\Rules\Length(4, 16),
             new FW\Rules\RegExp('/^[a-z]+$/i')
         );
         ->newString(Request::get('password'))
         ->addRules(
             new FW\Rules\NotEmpty(),
             new FW\Rules\MinLength(3),
             new App\Rules\PasswordStrength(40)
         );
         ->newString(Request::get('confirm'))
         ->addRules(
             new FW\Rules\NotEmpty(),
             new FW\Rules\Equals(Request::get('password'))
         )
         ->newString(Request::get('email'))
         ->addRules(
             new FW\Rules\NotEmpty(),
             new FW\Rules\ValidEmail(Request::get('email'))
         );
     if ($form->isValid()) {
         reg_user(Request::get('nickname'), Request::get('password'), Request::get('email'));
     } else {
         print_r($form->getErrors());
     }

    Народ ёбнулся на ООП

    Mitusbka, 04 Ноября 2009

    Комментарии (56)