コード例 #1
0
ファイル: functions.php プロジェクト: rfyiamcool/solrex
function updateCounter($username)
{
    $counter = getCounter($username);
    if ($counter == 'NaN' || $counter == 'Err') {
        return $counter;
    }
    updateImg($username, $counter);
    return TRUE;
}
コード例 #2
0
 //print_r($_POST);
 foreach ($_POST as $clave => $valor) {
     $nuevos[$clave] = $valor;
 }
 //echo "error = ".$_FILES['eperfil']['error'];exit(0);
 //no selecciono el checkbox
 if (empty($_POST['sinimg'])) {
     //echo "no existe";
     if ($_FILES['eperfil']['error'] == 0) {
         //validamos si cargo nuevo archivo
         $nombre_foto = $_FILES['eperfil']['name'];
         if ($viejos['cve_imagen'] != 1) {
             unlink("../../includes/img/perfil/" . $viejos['imgperfil']);
         }
         cargaArchivo($_FILES['eperfil']['name'], "../../includes/img/perfil/", $_FILES['eperfil']['tmp_name'], $viejos['imgperfil']);
         $idimg = updateImg($viejos['cve_imagen'], $_FILES['eperfil']['name'], 1, 'Foto Perfil', $Host, $User, $Pass, $dbName);
         if ($idimg != '' && $idimg != null) {
             $fileperfil = $idimg;
         }
     }
     //checkbox seleccionado (se eliminara la imagen)
 } else {
     //echo "si existe checkbox";
     if ($viejos['imgperfil'] != $fileperfil) {
         unlink("../../includes/img/perfil/" . $viejos['imgperfil']);
         eliminaArch($viejos['cve_imagen'], $Host, $User, $Pass, $dbName);
     }
     $nombre_foto = 'defecto.png';
     $fileperfil = 1;
 }
 $nuevos['imgpcve'] = $fileperfil;