예제 #1
0
function get_password($username)
{
    echoerr("Username: {$username}\n");
    echoerr("Password: "******"\n");
    return $password;
}
예제 #2
0
  }
  if (!isset($err)) {
    $f = openfile($cfg['listfile']);
    $exists = false;
    while ($item = readitem($f)) {
      if ($item['addr'] == $addr) {$exists = true;break;}
    }
    if ($exists) {
      $err = 'Ten adres mailowy ju¿ znajduje siê na naszej li¶cie';
    }
  }
  if (!isset($err)) {
    // subscribe successful
    writeitem($f, $addr);
    if (isset($cfg['returnto_sub']) && $cfg['returnto_sub'] != '') {
      header('Location: '.$cfg['returnto_sub']);
    }
    else { 
      printf($cfg['template'], 'Subscribed', 'Twój adres mailowy, '.$addr.', zostal dodany do naszej listy. Dziêkujemy.');
    }
  }
  else {
    // problem with subscription
    echoerr($err);
  }
}

function echoerr($err) {
  printf($GLOBALS['cfg']['template'], 'Error', '<font color="red">Error: '.$err.'</font>');
}
?>