(no subject)

Apr 28, 2009 11:50

Читаю код на похапе

if (IS_HOUSE){
                    add_house($id, strip_tags(trim(float_format($plot_square))), strip_tags(trim(float_format($building_up_square))), strip_tags(trim(float_format($house_total_square))), strip_tags(trim(float_format($house_1_floor_square))), strip_tags(trim(float_format($house_2_floor_square))), strip_tags(trim(float_format($house_3_floor_square))), trim($text_short), trim($text_full));
                    if (isset($_FILES["userfile_teaser"]) && is_uploaded_file($_FILES["userfile_teaser"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_teaser"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'teaser')) chmod(UPLOAD_DOC_PICS_PATH.$id.'teaser', 0777);
                    if (isset($_FILES["userfile_map"]) && is_uploaded_file($_FILES["userfile_map"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_map"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'map')) chmod(UPLOAD_DOC_PICS_PATH.$id.'map', 0777);
                    if (isset($_FILES["userfile_map2"]) && is_uploaded_file($_FILES["userfile_map2"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_map2"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'map2')) chmod(UPLOAD_DOC_PICS_PATH.$id.'map2', 0777);
                    if (isset($_FILES["userfile_map3"]) && is_uploaded_file($_FILES["userfile_map3"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_map3"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'map3')) chmod(UPLOAD_DOC_PICS_PATH.$id.'map3', 0777);
                    if (isset($_FILES["userfile_house1"]) && is_uploaded_file($_FILES["userfile_house1"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_house1"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'house1')) chmod(UPLOAD_DOC_PICS_PATH.$id.'house1', 0777);
                    if (isset($_FILES["userfile_house2"]) && is_uploaded_file($_FILES["userfile_house2"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_house2"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'house2')) chmod(UPLOAD_DOC_PICS_PATH.$id.'house2', 0777);

Типичный китайски быдлокодер, но дальше(уже edit вместо add)

if (IS_HOUSE){
                    edit_house($id, strip_tags(trim(float_format($plot_square))), strip_tags(trim(float_format($building_up_square))), strip_tags(trim(float_format($house_total_square))), strip_tags(trim(float_format($house_1_floor_square))), strip_tags(trim(float_format($house_2_floor_square))), strip_tags(trim(float_format($house_3_floor_square))), trim($text_short), trim($text_full));
                    if (isset($_FILES["userfile_teaser"]) && is_uploaded_file($_FILES["userfile_teaser"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_teaser"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'teaser')) chmod(UPLOAD_DOC_PICS_PATH.$id.'teaser', 0777);
                    if (isset($_FILES["userfile_map"]) && is_uploaded_file($_FILES["userfile_map"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_map"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'map')) chmod(UPLOAD_DOC_PICS_PATH.$id.'map', 0777);
                    if (isset($_FILES["userfile_map2"]) && is_uploaded_file($_FILES["userfile_map2"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_map2"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'map2')) chmod(UPLOAD_DOC_PICS_PATH.$id.'map2', 0777);
                    if (isset($_FILES["userfile_map3"]) && is_uploaded_file($_FILES["userfile_map3"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_map3"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'map3')) chmod(UPLOAD_DOC_PICS_PATH.$id.'map3', 0777);
                    if (isset($_FILES["userfile_house1"]) && is_uploaded_file($_FILES["userfile_house1"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_house1"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'house1')) chmod(UPLOAD_DOC_PICS_PATH.$id.'house1', 0777);
                    if (isset($_FILES["userfile_house2"]) && is_uploaded_file($_FILES["userfile_house2"]["tmp_name"]) && move_uploaded_file($_FILES["userfile_house2"]["tmp_name"], UPLOAD_DOC_PICS_PATH.$id.'house2')) chmod(UPLOAD_DOC_PICS_PATH.$id.'house2', 0777);
Previous post Next post
Up