<?php
session_start();
include_once 'config.php';
include_once 'src/clicktoconnect.php';
if( isset($_POST['userid']) && isset($_POST['password']) &&$_POST['userid']==$_SESSION['user_id']){
$_POST['use']=(int)$_POST['use'];
$_POST['use']=($_POST['use']!=0&&$_POST['use']!=1&&$_POST['use']!=2)?2:$_POST['use'];
$newpass= new clicktoconnect($bdd,$_POST['userid'],$_POST['path'],sha1(Salt. trim($_POST['password']).Salt),$_POST['use']);
$x=$newpass->updatepicture();
if($x){
echo "Success";
}
else{
echo "Failed";
}
}else{
echo "Failed";
}
?>
|