Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_SESSION['userid'] == '') {
- redirect('404.php', '0');
- }
- $user = $_SESSION['userid'];
- $select_user = mysql_query("SELECT * FROM cover_user WHERE user_id = '$user' ");
- $update_user = mysql_fetch_assoc($select_user);
- $user_email = $update_user['user_email'];
- $user_firma = $update_user['user_firma'];
- $user_link = $update_user['user_link'];
- $user_about = $update_user['user_about'];
- $smarty->assign('UserEmail', $user_email);
- $smarty->assign('UserFirma', $user_firma);
- $smarty->assign('UserLink', $user_link);
- $smarty->assign('UserAbout', $user_about);
- if ( isset($_POST['update']) ) {
- $email = $_POST['email'];
- $firma = $_POST['firma'];
- $link = $_POST['link'];
- $about = $_POST['about'];
- $password = $_POST['password'];
- $user = $_SESSION['userid'];
- $select_user = mysql_query("SELECT * FROM cover_user WHERE user_id = '$user' ");
- $update_user = mysql_fetch_assoc($select_user);
- $user_email = $update_user['user_email'];
- $user_firma = $update_user['user_firma'];
- $user_link = $update_user['user_link'];
- $user_about = $update_user['user_about'];
- $user_picture = $update_user['user_picture'];
- $user_password= $update_user['user_password'];
- if($email == ''){
- $post_error = '<div class="alert alert-danger"><h3>Please Enter Email Address</h3></div>';
- }else{
- $user_email = $email;
- }
- if ($password == '') {
- $user_password = $user_password;
- }else{
- $user_password = $password;
- }
- if ($firma == '') {
- $user_firma = $user_firma;
- }else{
- $user_firma = $firma;
- }
- if ($link == '') {
- $user_link = $user_link;
- }else{
- $user_link = $link;
- }
- if ($about == '') {
- $user_about = $user_about;
- }else{
- $user_about = $about;
- }
- if ($_FILES['photo']['size'] == '0') {
- $user_picture = $user_picture;
- }else{
- list($file,$error) = upload('photo','images/users/','jpg,jpeg,gif,png');
- $user_picture = $file;
- $post_error = $error;
- $user_picture = 'images/users/'.$file;
- }
- if ($post_error == '') {
- $insert = mysql_query("UPDATE cover_user SET
- user_id = '$user',
- user_email='$user_email',
- user_password='$user_password',
- user_firma='$user_firma',
- user_link='$user_link',
- user_about='$user_about',
- user_picture = '$user_picture' ");
- //redirect('edit.php', '2');
- $post_error = '<div class="alert alert-success"><h3>Your Profile Updates Success</h3></div>';
- }else{
- $post_error = '<div class="alert alert-danger"><h3>'.$error.'</h3></div>';
- }
- $smarty->assign('EditResult', $post_error);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement