Добрый вечер! Ребят помогите реализовать загрузку пользователем фотографии для фона страницы его профиля! в настройках профиля есть уже загрузка аватар и загрузка изоброжения как бы не на фон а в шапку пользователя код выглядит так : Код (Text): <?php if ($app->GetCurrentUserId() == 0) { $app->AddError(5,"account"); header('Location: /'); } $error_message = ''; $success_message = ''; $error = false; if (!empty($_POST)) { $ask_anonymous = (isset($_POST['ask_anonymous'])) ? $_POST['ask_anonymous'] : ''; $msg_inbox = (isset($_POST['msg_inbox'])) ? $_POST['msg_inbox'] : ''; $user_name = (isset($_POST['user_name'])) ? $_POST['user_name'] : ''; $user_login = (isset($_POST['user_login'])) ? $_POST['user_login'] : ''; $user_surname = (isset($_POST['user_surname'])) ? $_POST['user_surname'] : ''; $user_country = (isset($_POST['user_country'])) ? $_POST['user_country'] : ''; $user_city = (isset($_POST['user_city'])) ? $_POST['user_city'] : ''; $user_vk_page = (isset($_POST['user_vk_page'])) ? $_POST['user_vk_page'] : ''; $user_fb_page = (isset($_POST['user_fb_page'])) ? $_POST['user_fb_page'] : ''; $user_status = (isset($_POST['user_status'])) ? $_POST['user_status'] : ''; $user_sex = (isset($_POST['user_sex'])) ? $_POST['user_sex'] : ''; $token = (isset($_POST['token'])) ? $_POST['token'] : ''; $user_email = (isset($_POST['user_email'])) ? $_POST['user_email'] : ''; $user_login = trim($user_login); if ($token === $_SESSION['token']) { if ($ask_anonymous === "on") { // Unlock $i_am->AnonymousAsk(0); } else { // Lock $i_am->AnonymousAsk(1); } if ($msg_inbox === "on") { // Unlock $i_am->DisableMsg(0); } else { // Lock $i_am->DisableMsg(1); } if (!empty($user_login)) { if ($app->isCorrectLogin($user_login)) { if (!$app->LoginExists($user_login)) { $i_am->SetLogin($user_login); } } else { $error_message = $TEXT['error-page-format']; } } if ($app->EmailExists($user_email) == 0) { $i_am->SetEmail($user_email); } $user_status = htmlspecialchars($user_status); $user_name = htmlspecialchars($user_name); $user_surname = htmlspecialchars($user_surname); $user_city = htmlspecialchars($user_city); $i_am->SetStatus($user_status); $i_am->SetName($user_name); $i_am->SetSurName($user_surname); $i_am->SetSex($user_sex); $i_am->SetCity($user_city); $i_am->SetVKPage($user_vk_page); $i_am->SetFBPage($user_fb_page); $success_message = $TEXT['account-save-succes']; } else { $error = true; $error_message = 'Error!'; } } unset($i_am); $i_am = new user($dbo, $app->GetCurrentUserId()); $infouser = new infouser($dbo, $app->GetCurrentUserId()); GenGlobalToken(); $page_id = "settings"; $css_files = array("style.css"); $page_title = $TEXT['navi-account']; include_once("../html/common/header.inc.php"); ?> <body class="noface-theme"> <?php include_once('../html/common/topbar.inc.php'); ?> <div id="page-outer"> <div class="wrapper-main"> <div class="left-sidebar"> <div class="usermenu"> <ul> <li><a href="/account/password"><?php echo $TEXT['account-passw'] ?></a></li> <li><a href="/account/remove"><?php echo $TEXT['account-remove'] ?></a></li> <li class="divider"></li> </ul> <?php include_once("../html/common/leftbar.inc.php"); ?> </div> </div> <div class="profile-wrapper noface"> <div class="page-header"><?php echo $page_title; ?></div> <div class="questions-content"> <?php if(isset($_GET['action'])) { switch($_GET['action']) { case 'vk_connect_success': { ?> <div class="adv-data"> <a id="adv-remove" class="delete" href="javascript:;"></a> <span class="success center"><?php echo $TEXT['account-connect-success']; ?></span> </div> <?php break; } case 'vk_connect_error': { ?> <div class="adv-data"> <a id="adv-remove" class="delete" href="javascript:;"></a> <span class="error center"><?php echo $TEXT['account-connect-error']; ?></span> </div> <?php break; } default: { break; } } } if ($error_message > '') { ?> <div class="adv-data"> <a id="adv-remove" class="delete" href="javascript:;"></a> <span class="error center"><?php echo $error_message; ?></span> </div> <?php } else { if ($success_message > '') { ?> <div class="adv-data"> <a id="adv-remove" class="delete" href="javascript:;"></a> <span class="success center"><?php echo $success_message; ?></span> </div> <?php } } ?> <div class="content-main" id="content-settings"> <form id="loginform" class="form-horizontal" method="POST" action="/account/settings" enctype="text/html"> <input type="hidden" id="settings_token" name="token" value="<?php echo $_SESSION['token']; ?>"> <fieldset id="profile-image-controls" class="control-group"> <label class="control-label" for="profile_image_uploaded_data"><?php echo $TEXT['account-photo']; ?></label> <div class="controls"> <div class="uploader-avatar clearfix"> <img style="float: left" name="<?php echo $infouser->login; ?>" class="settings-avatar upload-photo" src="<?php echo $infouser->PrintUrl_160(); ?>"> <div class="uploader-tools" style="float: left; margin-left: 20px;"> <a class="prj-button prj-button-white" style="width: 200px;" id="upload-photo"><?php echo $TEXT['account-change-photo']; ?></a> <p><?php echo $TEXT['error-img-upload']; ?></p> <p><a href="/account/photo"><?php echo $TEXT['error-photo-addon']; ?></a></p> </div> </div> </div> </fieldset> <fieldset id="profile-image-controls" class="control-group" style="margin-top: 20px;"> <label class="control-label" for="profile_image_uploaded_data"><?php echo $TEXT['account-cover']; ?></label> <div class="controls"> <div class="uploader-avatar clearfix"> <img style="float: left" name="<?php echo $infouser->login; ?>" class="settings-avatar upload-background" src="<?php echo $infouser->PrintUrl_cover(); ?>"> <div class="uploader-tools" style="float: left; margin-left: 20px;"> <a class="prj-button prj-button-white" style="width: 200px;" id="upload-background"><?php echo $TEXT['account-change-cover']; ?></a> </div> </div> </div> </fieldset> <hr> <fieldset id="username_fieldset" class="control-group"> <div class="controls"> <?php if ($i_am->ask_state == 0) { echo "<label><input name=\"ask_anonymous\" type=\"checkbox\" checked=\"checked\"> {$TEXT['account-allow-ask']}</label>"; } else { echo "<label><input name=\"ask_anonymous\" type=\"checkbox\"> {$TEXT['account-allow-ask']}</label>"; } if ($i_am->msg_state == 0) { echo "<label><input name=\"msg_inbox\" type=\"checkbox\" checked=\"checked\"> {$TEXT['account-allow-msg']}</label>"; } else { echo "<label><input name=\"msg_inbox\" type=\"checkbox\"> {$TEXT['account-allow-msg']}</label>"; } ?> </div> </fieldset> <hr /> <?php if ($infouser->vk_id != 0) { if ($infouser->login === "id".$infouser->vk_id) { ?> <fieldset id="userlogin_fieldset" class="control-group"> <label for="user_login" class="control-label"><?php echo $TEXT['pagename']; ?></label> <div class="controls"> <input id="user_login" maxlength="16" name="user_login" type="text" value="<?php echo $infouser->login; ?>"> <p><?php echo $TEXT['pagename-comment']; ?></p> </div> </fieldset> <hr/> <?php } } ?> <fieldset id="username_fieldset" class="control-group"> <label for="user_name" class="control-label"><?php echo $TEXT['account-name']; ?></label> <div class="controls"> <input id="user_name" maxlength="10" name="user_name" type="text" value="<?php echo $infouser->name; ?>"> <p><?php echo $TEXT['account-name-comment']; ?></p> </div> </fieldset> <fieldset id="usersurname_fieldset" class="control-group"> <label for="user_surname" class="control-label"><?php echo $TEXT['account-surname']; ?></label> <div class="controls"> <input id="user_surname" maxlength="16" name="user_surname" type="text" value="<?php echo $infouser->surname; ?>"> <p><?php echo $TEXT['account-surname-comment']; ?></p> </div> </fieldset> <fieldset class="control-group"> <label for="user_sex" class="top_5"><?php echo $TEXT['account-sex']; ?></label> <div class="controls"> <select id="user_sex" name="user_sex"> <?php foreach ($SEX as $name => $val) { if ($i_am->GetSex() == $val) { echo "<option value=\"$val\" selected=\"$val\">$name</option>"; } else { echo "<option value=\"$val\">$name</option>"; } } ?> </select> </div> </fieldset> <hr> <fieldset id="username_fieldset" class="control-group"> <label for="user_status" class="control-label"><?php echo $TEXT['account-status']; ?></label> <div class="controls"> <textarea id="user_status" maxlength="400" name="user_status"><?php echo $infouser->status; ?></textarea> <p><?php echo $TEXT['account-status-comment']; ?></p> </div> </fieldset> <hr> <fieldset id="email_fieldset" class="control-group"> <label for="user_city" class="control-label"><?php echo $TEXT['account-city']; ?></label> <div class="controls"> <input id="user_city" maxlength="25" name="user_city" type="text" value="<?php echo $infouser->city; ?>"> <p><?php echo $TEXT['account-city-comment']; ?></p> </div> </fieldset> <hr> <fieldset class="control-group"> <label for="user_vk_page" class="control-label"><?php echo $TEXT['account-vkpage']; ?></label> <div class="controls"> <input id="user_vk_page" maxlength="60" name="user_vk_page" type="text" value="<?php echo $infouser->vk_page; ?>"> <p><?php echo $TEXT['account-vkpage-comment']; ?></p> </div> </fieldset> <fieldset class="control-group"> <label for="user_fb_page" class="control-label"><?php echo $TEXT['account-fbpage']; ?></label> <div class="controls"> <input id="user_fb_page" maxlength="60" name="user_fb_page" type="text" value="<?php echo $infouser->fb_page; ?>"> <p><?php echo $TEXT['account-fbpage-comment']; ?></p> </div> </fieldset> <fieldset class="control-group"> <label for="user_email" class="control-label"><?php echo $TEXT['email']; ?></label> <div class="controls"> <input id="user_email" maxlength="50" name="user_email" type="text" value="<?php echo $i_am->GetEmail(); ?>"> <p><?php echo $TEXT['email-comment'] ?></p> </div> </fieldset> <hr> <div class="form-actions"> <button id="settings_save" class="prj-button prj-button-blue" type="submit"><?php echo $TEXT['action-save']; ?></button> </div> </form> </div> </div> </div> <div class="small-footer"> <?php include_once("../html/common/footer.inc.php"); ?> </div> </div> </div> </body> </html>
блокнот notepad++ : Can't find the text: "move_uploaded_file". Вашего труда не вижу в реализации загрузки чего - либо.
вот есть форма добавления аваторки и фона в шапку профиля Код (Text): <fieldset id="profile-image-controls" class="control-group"> <label class="control-label" for="profile_image_uploaded_data"><?php echo $TEXT['account-photo']; ?></label> <div class="controls"> <div class="uploader-avatar clearfix"> <img style="float: left" name="<?php echo $infouser->login; ?>" class="settings-avatar upload-photo" src="<?php echo $infouser->PrintUrl_160(); ?>"> <div class="uploader-tools" style="float: left; margin-left: 20px;"> <a class="prj-button prj-button-white" style="width: 200px;" id="upload-photo"><?php echo $TEXT['account-change-photo']; ?></a> <p><?php echo $TEXT['error-img-upload']; ?></p> <p><a href="/account/photo"><?php echo $TEXT['error-photo-addon']; ?></a></p> </div> </div> </div> </fieldset> <fieldset id="profile-image-controls" class="control-group" style="margin-top: 20px;"> <label class="control-label" for="profile_image_uploaded_data"><?php echo $TEXT['account-cover']; ?></label> <div class="controls"> <div class="uploader-avatar clearfix"> <img style="float: left" name="<?php echo $infouser->login; ?>" class="settings-avatar upload-background" src="<?php echo $infouser->PrintUrl_cover(); ?>"> <div class="uploader-tools" style="float: left; margin-left: 20px;"> <a class="prj-button prj-button-white" style="width: 200px;" id="upload-background"><?php echo $TEXT['account-change-cover']; ?></a> </div> </div> </div> </fieldset> получаеться если я добавлю еще одну форму так верно будет? или же что то нужно доделовать?!
Во первых вы показали не форму а всего лишь блок чего то там ... блок из тегов. Сама форма Примеры. Во вторых, чтобы реализовать загрузку аватарки, нужно не только форму как в примерах описано иметь, но и сам код на сервере PHP.