GIF89a;
| Direktori : /home/serb/public_html/ |
| Current File : /home/serb/public_html/change-picture.php |
<? session_start();
include("lib/globals.php");
include("lib/common.php");
include("lib/functions.php");
$page="change_pass";
?>
<? include "includes/header_top.php";?>
<script language="javascript">
function validate()
{
if(document.chngpwd.newPassword.value=="")
{
alert("Enter your password");
document.chngpwd.newPassword.focus();
return false;
}
if(document.chngpwd.newPassword.value!=document.chngpwd.cnfPassword.value)
{
alert("Password not match");
document.chngpwd.cnfPassword.focus();
return false;
}
}
</script>
<?
if($_POST)
{
if($_FILES['ad_image1']['name'])
{
$manu_imagename1=time().$_FILES['ad_image1']['name'];
move_uploaded_file($_FILES['ad_image1']['tmp_name'],'profile_pic/'.$manu_imagename1);
}
else
{
$manu_imagename1=$_POST['ad_img1'];
}
$upd="UPDATE user_info SET pic='$manu_imagename1' WHERE userid='".$_SESSION['userid']."'";
execute_query($upd);
?>
<script language="javascript">
location.href="change-picture.php?msg=1";
</script>
<?
} ?>
<body>
<? include "includes/header.php";?>
<div class="hdr_foo">
<div class="hrd_ftmenu">
</div>
</div>
<div class="main_bg">
<div style="height:32px;"></div>
<div style="width:1000px; margin:0 auto;">
<div class="menuleft_contain">
<? include "includes/acount_leftcontent.php";?>
</div>
<div class="acountright_contain">
<?
$sql="SELECT * FROM user_info WHERE userid='".$_SESSION['userid']."'";
$res=execute_query($sql);
$row=mysql_fetch_array($res);
$num=mysql_num_rows($res);
?>
<div class="acccmid1_header">Change Picture</div>
<div class="accountrightct_mid">
<div class="small_space"></div>
<div class="profile_data">
<?php /*?><?
$sql="SELECT * FROM user_info WHERE userid='".$_SESSION['userid']."'";
$res=execute_query($sql);
$row=mysql_fetch_array($res);
$num=mysql_num_rows($res);
?><?php */?>
<? if($_GET['msg']==1){ ?>
<p style="color:#ff9131; font-family:'Open Sans',sans-serif; text-align:center;">Your Profile Picture Has Changed.</p>
<? } ?>
<form action="<?=$_SERVER['PHP_SELF'] ?>" method="post" name="chngpwd" enctype="multipart/form-data" onSubmit="return validate();">
<table border="0" cellpadding="0" cellspacing="7" align="center" style="margin:0 auto;">
<tr height="5"></tr>
<tr>
<td class="logintext">Profile Picture :</td>
<td>
<?
if($row['pic']=="")
{ ?>
<img width="135" height="170" style="border:1px solid #ffffff; border-radius:5px;" src="images/no_photo_female.gif" alt="">
<? }else
{
?>
<img width="135" height="170" style="border:1px solid #ffffff; border-radius:5px;" src="profile_pic/<?=$row['pic']?>" alt="">
<? } ?></td>
</tr>
<tr>
<td class="logintext">Change Picture :</td>
<td>
<input type="file" name="ad_image1" />
<input type="hidden" name="ad_img1" value="<?=$row['pic']?>" />
</td>
</tr>
<tr height="15"></tr>
<tr>
<td></td>
<td><input type="image" src="images/submit.png" /></td>
</tr>
<tr height="10"></tr>
</table>
</form>
<br class="spacer" />
</div>
<br class="spacer" />
</div>
</div>
<br class="spacer" />
</div>
<br/>
</div>
<? include "includes/footer.php";?>