Vladsvn
Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору <?php session_start(); $_SESSION['USER_ID'] = 35; // Это имитация зарегистрированного пользователя. // Это имитация получения текста из базы if(file_exists("name_photo_1.txt")) $name_photo_1 = file_get_contents("name_photo_1.txt"); else $name_photo_1 = ""; if (!isset($_SESSION['USER_ID'])) { header("Location: /"); header("HTTP/1.0 301 Moved permanently"); } $user_id = $_SESSION['USER_ID']; ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video{margin:0;padding:0;border:0;font-family:Arial, Helvetica, sans-serif;vertical-align:inherit;list-style-type:none;} html, body{color:#000;font-size:16px;} @media (max-width: 640px) { html, body{font-size:14px;} } </style> <link href="profile.css" rel="stylesheet" type="text/css"> </head> <body> <header> <form method="POST" action="pro-set.php"> <br><br> <details> <summary style="color: #1304FA; text-decoration: underline;">Фото 1</summary> <div id="comment_input_box_1" class="thesis--empty"> <img class='loaded' src='<?php $file_1 = "1/" . $user_id . ".jpg"; $file_2 = "1/" . $user_id . ".gif"; $file_3 = "1/" . $user_id . ".png"; if(file_exists($file_1)) echo "1/" . $user_id . ".jpg"; else if(file_exists($file_2)) echo "1/" . $user_id . ".gif"; else if(file_exists($file_3)) echo "1/" . $user_id . ".png"; ?>' width='300px' height='300px' /> <div id="comment_uploader_1" ></div> </div> <div> <div class="thesis__upload_file" onclick="site_fileload(this);"> <img src="knv.jpg" width="17" height="17"> </div> <input class="site_load_file_1" style="display: none;" accept="image/*" name="loadfile" type="file" /> </div> <br> <p>Текст под фото</p> <textarea name="name_photo_1" rows="" cols="" maxlength="200" wrap="soft" style="width: 250px; height: 50px;"><?php echo $name_photo_1; ?></textarea> </details> <br> <input type="submit" value="Сохранить"> </form> <script src="profile.js"></script> </body> </html> |