код загрузки
load_content.php
<?php
$login=!empty($_POST['upload_login'])?$_POST['upload_login']:null;
$date_load=date('YmdHis');
$max_image_size=150*150;
$valid_types=array("gif","jpg","png","jpeg");
if(isset($_FILES['upload_image'])&&$_FILES['upload_image']['error']===0){
if(!file_exists('./loads/'.$login.'')){mkdir("./loads/$login",0700);}
mkdir("./loads/$login/$date_load",0700);
if(move_uploaded_file($_FILES['upload_image']['tmp_name'],'./loads/'.$login.'/'.$date_load.'/'.$_FILES['upload_image']['name']));}
?>
<body onload="parent.document.getElementById('upload_content_final').innerHTML=document.body.innerHTML">
<?php echo('<input class="img_code" value="'.'[IMG]http://youexpert.ru/modules/lessons/loads/'.$login.'/'.$date_load.'/'.$_FILES['upload_image']['name'].'[/IMG]'.'"/><p class="about_input">Код рисунка 1</p><a class="add_lesson_answer" href="javascript:">(C)<span>Скопировать в буфер обмена</span></a>')?>
</body>
index.php
<iframe name="upload_content_iframe" class="none"></iframe>
<form class="upload_content_form" method="post" action="http://youexpert.ru/modules/lessons/load_content.php" target="upload_content_iframe" enctype="multipart/form-data">
<textarea name="upload_login" class="none"><?php echo($login)?></textarea><input name="upload_image" type="file"/><button type="submit">Загрузить</button><p class="about_input">Загрузка изображений</p><a class="add_lesson_answer" href="javascript:">(?)<span>Загружайте скрины и вставляйте сгенерированный код в форму web урока</span></a>
</form>
<div class="the_full_area"></div>
<div id="upload_content_final"></div>