jeg har prøvet at ændre den samt oprette et felt i databasen ved navn "born" men selve feltet bliver ikke gemt i mysql tabellen. min nye kode ser således ud: kan nogen af jer gytter se fejlen? hvis du/i kan hæver jeg mit spørgsmål til 400points. på forhånd tak
<?PHP
include("common.php");
$page = getVar("GET", "page");
$uid = getVar("SESSION", "lw_uid", 0);
function sendConfirmMail($email, $name, $accID, $accName, $accLogin = "")
{
ini_set("sendmail_from", $email);
mail($email, "HLparty.dk - Brugergodkendelse", "Hej " . $name . "
Klik på følgende link for at godkende din profil:
" . SITE_URL . "user.php?page=confirm&cid=" . urlencode(md5($accID . "#" . $accName . "#" . $email . "#" .
(strlen($accLogin) > 0 ? $accLogin : "00000000000000"))) . "
Med venlig hilsen
/// HLparty.dk", "From: \"" . SITE_NAME . "-robot\" <" . SITE_DEFAULT_SENDER . ">
MIME-Version: 1.0
Content-type: text/plain; charset=iso-8859-1");
ini_restore("sendmail_from");
}
switch ($page)
{
case "confirm":
if ($uid > 0) {
header("Location: index.php");
exit();
}
designTop("Brugerprofil");
?><h1>Bekræftning af profil</h1>
<?
if ($Conn->IsConnected()) {
$confirmID = getVar("GET", "cid");
$errMsg = "Ugyldig ID - kunne ikke godkende e-mail-adressen!";
if (strlen($confirmID) > 0) {
$rs = $Conn->Execute("SELECT `id` FROM `users` WHERE MD5(CONCAT_WS('#', `id`, `username`, `email`, `lastLogin`)) = " . $Str->SQL($confirmID) . " AND `status` = 'pre-user'");
if ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) {
$Conn->Execute("UPDATE `users` SET `added` = `added`, `status` = 'user' WHERE `id` = " . $row["id"]);
$errMsg = "Din e-mail er nu blevet bekræftet!<br />
<br />
Du kan nu logge ind på din profil ...";
}
}
echo $errMsg;
}
break;
case "reconfirm":
if ($uid > 0) {
header("Location: index.php");
exit();
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = getVar("POST", "user");
if (strlen($username) > 0) {
$Conn = new MySQLDatabase();
if ($Conn->IsConnected()) {
$rs = $Conn->Execute("SELECT `id`, `username`, `name`, `email`, `status`, `lastLogin` FROM `users` WHERE LOWER(`username`) = LOWER(" . $Str->SQL($username) . ") AND `status` IN ('pre-user', 'user')");
if ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) {
if ($row["status"] == "pre-user") {
header("Location: " . $_SERVER["PHP_SELF"] . "?page=reconfirm&status=sent");
sendConfirmMail($row["email"], $row["name"], $row["id"], $row["username"], $row["lastLogin"]);
} else {
header("Location: " . $_SERVER["PHP_SELF"] . "?page=reconfirm&status=nopre");
}
$Conn->Disconnect();
} else {
header("Location: " . $_SERVER["PHP_SELF"] . "?page=reconfirm&status=unknown");
}
exit();
}
}
}
designTop("Brugerprofil");
$status = getVar("GET", "status");
if (strlen($status) > 0) {
?><h1>Bekræftelse af profil</h1>
<?
if ($status == "sent") {
?>En mail er nu blevet sendt til din e-mail.
<?
} else if ($status == "nopre") {
?>Den valgte profil er eksistere ikke, eller også er profilen allerede bekræftet.
<?
} else {
?>Den valgte profil er eksistere ikke.
<?
}
} else {
?><h1>Din profil er ikke blevet godkendt!</h1>
<?
$username = getVar("GET", "user");
$email = getVar("GET", "email");
if (strlen($username) > 0 && strlen($email) > 0) {
$rs = $Conn->Execute("SELECT `username`, `email` FROM `users` WHERE LOWER(`username`) = LOWER(" . $Str->SQL($username) . ") AND LOWER(`email`) = LOWER(" . $Str->SQL($email) . ") AND `status` IN ('pre-user', 'user')");
if ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) {
?>For at systemet sikres mod kun gyldige e-mail-adresser, kræves hver profil godkendt.<br />
Derfor skal der sendes en mail til din e-mail, som du således bekræfter via et link der står deri.<br />
<br />
Bekræft din e-mail ved at trykke på Bekræft E-mail, nedenfor.<br />
<br />
Hvis din e-mail af en eller anden grund ikke eksistere mere, <a href="contact.php">kontakt os venligst</a><br />
<br /><br />
<h3>Brugernavn:</h3>
<?= $Str->HTMLEncode($row["username"]) ?><br />
<h3>E-mail:</h3>
<?= $Str->HTMLEncode($row["email"]) ?><br />
<br />
<form action="<?= $_SERVER["PHP_SELF"]; ?>?page=reconfirm" method="post">
<input type="hidden" name="user" value="<?= $Str->HTMLEncode($row["username"]); ?>" />
<input type="submit" name="" value="Bekræft E-mail" />
</form>
<?
} else {
?>Ingen bruger fundet med de angivede data!<br />
<br />
Dette kan skyldes at:<br />
- Brugernavnet findes ikke<br />
- Brugernavnet og e-mailen stemmer ikke overens!<br />
<?
}
} else {
?>Intet brugernavn eller e-mail er ikke angivet!
<?
}
}
break;
case "lostpass":
if ($uid > 0) {
header("Location: index.php");
exit();
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = getVar("POST", "Username");
$email = getVar("POST", "Email");
$zipcode = getVar("POST", "Zipcode");
if ((strlen($username) > 0 || strlen($email) > 0) && preg_match("/^[0-9]+$/", $zipcode)) {
$Conn = new MySQLDatabase();
if ($Conn->IsConnected()) {
$rs = $Conn->Execute("SELECT `id`, `username`, `name`, `email` FROM `users` WHERE " . (strlen($username) > 0 ? "LOWER(`username`) = LOWER(" . $Str->SQL($username) . ")" : "LOWER(`email`) = LOWER(" . $Str->SQL($email) . ")") . " AND `zipcode` = " . $Str->SQL($zipcode, "int") . " AND `status` IN ('pre-user', 'user', 'admin')");
if ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) {
list($usec, $sec) = explode(" ", microtime());
mt_srand((float) $sec + ((float) $usec * 100000));
$newPW = substr(md5(uniqid(mt_rand(), true)), 0, 10);
$Conn->Execute("UPDATE `users` SET `added` = `added`, `password` = MD5(" . $Str->SQL($newPW) . ") WHERE `id` = " . $row["id"]);
$Conn->Disconnect();
header("Location: " . $_SERVER["PHP_SELF"] . "?page=lostpass&status=sent");
ini_set("sendmail_from", $email);
mail($email, "hlparty.dk - Brugergodkendelse", "Hej " . $row["name"] . "
Du har ansøgt om en ny adgangskode.
Dine nye login-informationer er således:
Brugernavn: " . $row["username"] . "
Adgangskode: " . $newPW . "
Med venlig hilsen
/// HLparty.dk", "From: \"" . SITE_NAME . "-robot\" <" . SITE_DEFAULT_SENDER . ">\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-type: text/plain; charset=iso-8859-1\r\n");
ini_restore("sendmail_from");
exit();
}
}
}
}
designTop("Brugerprofil");
?><h1>Hjælp, jeg har glemt min kode :,-(</h1>
<?
$status = getVar("GET", "status");
if ($status == "sent") {
?>En e-mail er nu blevet sendt til dig, med en ny adgangskode.<br />
<?
} else {
?>Nåååh lille pus - men så er det jo godt at vi kan hjælpe dig!<br />
<br />
Dog er det ikke muligt at oplyse dig din nuværende adgangskode, så derfor bliver du nødt til at få en ny (som du så senere selv kan ændre i din profil, når du har logget ind).<br />
<br />
Ved at udfylde følgende form, vil en mail blive sendt til din e-mail, hvori der står din nye adgangskode.<br />
<br />
Du skal herunder indtaste dit brugernavn eller e-mail, samt i begge tilfælde indtaste dit postnr. - og dernæst trykke på <i>Send ny adgangskode</i><br />
<br />
<form action="<?= $_SERVER["PHP_SELF"]; ?>?page=lostpass" method="post">
<table border="0" cellpadding="1" cellspacing="0" style="line-height: 15px;">
<tr>
<td><b>Brugernavn</b>:</td>
<td><input type="text" name="Username" value="" maxlength="20" /></td>
</tr>
<tr>
<td colspan="2">eller</td>
</tr>
<tr>
<td><b>E-mail</b>:</td>
<td><input type="text" name="Email" value="" /></td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<tr>
<td><b>Postnr.</b>: *</td>
<td><input type="text" name="Zipcode" value="" size="4" maxlength="4" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="" value="Send ny adgangskode" /></td>
</tr>
</table>
</form>
<br />
* Postnr. skal være den du indtastede ved oprettelsen - dette er for at undgå misbrug...
<?
}
break;
case "pw":
$check = array();
if ($_SERVER["REQUEST_METHOD"] == "POST" && $uid > 0) {
$password = getVar("POST", "Password");
$password_new = getVar("POST", "NewPassword");
$password_new2 = getVar("POST", "NewPassword2");
$check["Password"] = strlen($password) > 0;
$check["NewPassword"] = strlen($password_new) > 0 && !strcmp($password_new, $password_new2);
if (!in_array(false, $check)) {
$Conn = new MySQLDatabase();
if ($Conn->IsConnected()) {
$Conn->Execute("UPDATE `users` SET `added` = `added`, `password` = MD5(" . $Str->SQL($password_new) . ") WHERE `password` = " . $Str->SQL(md5($password)));
if (!@mysql_affected_rows()) {
$check["Password"] = $check["NewPassword"] = false;
} else {
$Conn->Disconnect();
header("Location: " . $_SERVER["PHP_SELF"] . "?page=pw&status=changed");
exit();
}
}
}
}
designTop("Brugerprofil");
?><h1>Skift adgangskode</h1>
<?
if ($uid > 0) {
if (getVar("GET", "status", "") == "changed") {
?>Din adgangskode er nu ændret!<br />
<?
} else {
?><form action="<?= $_SERVER["PHP_SELF"]; ?>?page=pw" method="post">
<table border="0" cellpadding="1" cellspacing="0" style="line-height: 15px;">
<tr valign="top">
<td>Gl. adgangskode:</td>
<td><input type="password" name="Password" value="" autocomplete="off"<?= chkFilledState("Password"); ?> /></td>
</tr>
<tr valign="top">
<td>Ny adgangskode:</td>
<td><input type="password" name="NewPassword" value="" autocomplete="off"<?= chkFilledState("NewPassword"); ?> /></td>
</tr>
<tr valign="top">
<td>Bekræft adgangskode:</td>
<td><input type="password" name="NewPassword2" value="" autocomplete="off"<?= chkFilledState("NewPassword"); ?> /></td>
</tr>
<tr valign="top">
<td></td>
<td><input type="submit" name="" value="Skift adgangskode" /></td>
</tr>
</table>
</form>
<?
}
} else {
?>Denne funktion kan kun benyttes, når du er logget på systemet.
<?
}
break;
case "updated":
designTop("Brugerprofil");
?><h1>Ændringerne i din profil er blevet gemt!</h1>
<?
if (getVar("GET", "show", "") == "mail") {
?>Da du ændrede din e-mail adresse, skal du nu bekræfte din e-mail før du kan bruge din konto.<br />
<br />
Dette gøres ved at klikke på det link, der står i den mail som du gerne skulle have modtaget nu (kan dog gå et par minutter før mailen når frem)!
<?
}
break;
case "added":
designTop("Brugerprofil");
?><h1>Din profil er nu blevet oprettet!</h1>
Før at du kan bruge din profil, skal du bekræfte din e-mail<br />
<br />
Dette gøres ved at klikke på det link, der står i den mail som du gerne skulle have modtaget nu (kan dog gå et par minutter før mailen når frem)!
<?
break;
case "unknown";
designTop("Brugerprofil");
?>Ukendt bruger...
<?
break;
case "profile":
$user = getVar("GET", "user");
designTop("Brugerprofil" . (strlen($user) > 0 ? " - " . $user : ""));
if (strlen($user) > 0) {
if ($Conn->IsConnected()) {
$rs = $Conn->Execute("SELECT `id`, `username`, `name`, `born`, `url`, IFNULL(`clan`, '- ingen angivet -') AS `clan`, `picture`, UNIX_TIMESTAMP(`added`) AS `added`, UNIX_TIMESTAMP(`lastLogin`) AS `lastLogin`, `description` FROM `users` WHERE `username` = " . $Str->SQL($user));
if ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) {
if ($row["picture"] == 1) {
$imgInfo = getimagesize("images/users/" . $row["id"] . ".jpg");
echo("<img src=\"images/users/" . $row["id"] . ".jpg\" class=\"userPic\" " . $imgInfo[3] . " />\r\n");
}
?><h1>Profil for <?= $Str->HTMLEncode($row["username"]); ?></h1>
<table border="0" cellpadding="1" cellspacing="0">
<tr>
<td width="75">Navn:</td>
<td><?= $Str->HTMLEncode($row["name"]); ?></td>
</tr>
<tr>
<td>Klan:</td>
<td><?= $Str->HTMLEncode($row["clan"]); ?></td>
</tr>
<tr>
<td>URL:</td>
<td><?= (strlen($row["url"]) > 0 ? "<a href=\"" . $Str->HTMLEncode($row["url"]) . "\" target=\"_blank\">" . $Str->HTMLEncode($row["url"]) . "</a>" : "- ingen -"); ?></td>
</tr>
<tr>
<td>Oprettet:</td>
<td><?= $row["added"] > 0 ? strftime("%d. %B %Y %H:%M", $row["added"]) : "- ukendt -"; ?></td>
</tr>
<tr>
<td>Sidste login:</td>
<td><?= $row["lastLogin"] > 0 ? strftime("%d. %B %Y %H:%M", $row["lastLogin"]) : "Aldrig"; ?></td>
</tr>
<tr>
<td></td>
<td><br /><?= $Str->HTMLEncode(strlen($row["description"]) > 0 ? $row["description"] : "<b>" . $row["username"] . "</b> er kedelig, og har valgt ikke at skrive noget om sig selv :-P", true, true, true, true); ?></td>
</tr>
</table>
<?
} else {
?><h1>Ukendt bruger</h1>
Det valgte brugernavn, eksistere ikke i vores system!
<?
}
$Conn->Disconnect();
}
} else {
?><h1>Ukendt bruger</h1>
Ingen bruger valgt - kan ikke søge!
<?
}
break;
case "picture":
if ($uid > 0) {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$picture = getVar("FILES", "userPic");
if (is_uploaded_file($picture["tmp_name"])) {
$src = @imagecreatefromstring(file_get_contents($picture["tmp_name"]));
if (is_resource($src)) {
$width = @imagesx($src);
$height = @imagesy($src);
$new_w = ($width > 200 ? 200 : $width);
$new_h = ($width > 200 ? round(200 / $width * $height) : $height);
$img = @imagecreatetruecolor ($new_w, $new_h);
@imagecopyresampled($img, $src, 0, 0, 0, 0, $new_w, $new_h, $width, $height);
$success = @imagejpeg($img, "images/users/" . $uid . ".jpg", 70);
@imagedestroy($img);
$Conn = new MySQLDatabase();
if ($Conn->IsConnected()) {
$Conn->Execute("UPDATE `users` SET `added` = `added`, `picture` = '1' WHERE `id` = " . $Str->SQL($uid, "int"));
$Conn->Disconnect();
}
}
}
header("Location: " . $_SERVER["PHP_SELF"] . "?page=picture&upload=" . (isset($success) ? "success" : "error&err=" . (isset($src) ? 5 : (is_array($picture) ? $picture["error"] : 4))));
exit();
}
$user = getVar("SESSION", "lw_uname");
designTop("Brugerprofil" . (strlen($user) > 0 ? " - " . $user : "") . " - Billede");
?><h1>Billede</h1>
<?
if (getVar("GET", "upload", "") == "success") {
?>Dit billede er nu uploaded til din profil<br />
<br />
<img src="images/users/<?= $uid; ?>.jpg?x=<?= urlencode(time()); ?>" class="border" <?= $imgInfo[3]; ?> />
<?
} else {
$errCode = getVar("GET", "err", 5);
$errValues = array(
1 => "Fil-størrelsen er for stor (1)",
2 => "Fil-størrelsen er for stor (2)",
3 => "Kun noget af filen blev uploadet",
4 => "Ukendt fejl",
5 => "Ukendt billedtype"
);
?>Dit billede kunne ikke uploades!<br />
<br />
Fejlen skyldes:<br />
- <?= isset($errValues[$errCode]) ? $errValues[$errCode] : $errValues[4]; ?>
<?
}
} else {
designTop("Brugerprofil - Billede");
?><h1>Ikke logget ind</h1>
Du skal være logget ind for at kunne benytte denne funktion!
<?
}
break;
default:
$check = array();
$accUsername = "";
$userName = $userAddress = $userZipcode = $userBorn = $userPhone = $userCellular = $userClan = $userEmail = "";
$userURL = $userICQ = $userMSN = $userDescription = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($uid <= 0) {
$accUsername = getVar("POST", "Username");
$accPassword = getVar("POST", "Password");
$accPassword2 = getVar("POST", "Password2");
}
$userName = getVar("POST", "Name");
$userAddress = getVar("POST", "Address");
$userZipcode = getVar("POST", "Zipcode");
$userBorn = getVar("POST", "Born");
$userPhone = getVar("POST", "Phone");
$userCellular = getVar("POST", "Cellular");
$userClan = getVar("POST", "Clan");
$userEmail = getVar("POST", "Email");
$userURL = preg_replace("/^http:\/\/$/", "", preg_replace("/^(?!http[s]?:\/\/)(.*)$/i", "
http://\\1", getVar("POST", "URL")));
$userICQ = getVar("POST", "ICQ");
$userMSN = getVar("POST", "MSN");
$userDescription = getVar("POST", "Description");
load_module("validate");
$objVD = new moduleValidate();
if ($uid <= 0) {
$check["Username"] = $objVD->Username($accUsername, USERNAME_ALLOWED_LENGTH,
USERNAME_ALLOWED_CHARS, USERNAME_ILLEGAL_WORDS, USERNAME_ILLEGAL_STRINGS);
if (!$check["Username"]) $err = "- Brugernavnet indeholder ugyldige tegn<br />";
$check["Password"] = strlen($accPassword) > 0 && !strcmp($accPassword, $accPassword2);
}
$check["Name"] = preg_match("/[^ ]{2,}[ ][^ ]{2,}/", $userName);
if (!chkFilledState_bool("Username")) {
if (!isset($err)) $err = "";
$err .= "- Dit navn skal indeholder et gyldigt navn og efternavn<br />";
}
$check["Email"] = $objVD->Email($userEmail);
$check["Address"] = preg_match("/[^ ]+[ ][^ ]+/", $userAddress);
$check["Zipcode"] = preg_match("/^[0-9]+$/", $userZipcode);
if (!in_array(false, $check)) {
$Conn = new MySQLDatabase();
if ($Conn->IsConnected()) {
$uSuccess = $uSendMail = $uCreated = false;
if ($uid > 0) {
$rs = $Conn->Execute("SELECT `email`, `username`, `lastLogin` FROM `users` WHERE `id` = " . $Str->SQL($uid) . " AND `status` IN ('user', 'admin')");
if ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) {
$uSendMail = strcasecmp($userEmail, $row["email"]);
$accUsername = $row["username"]; $logintime = $row["lastLogin"]; $uSuccess = true;
$Conn->Execute("UPDATE `users` SET `name` = " . $Str->SQL($userName) . ", `address` = " . $Str->SQL($userAddress) . ", `zipcode` = " . $Str->SQL($userZipcode, "int") . ", `phone` = " . $Str->SQL($userPhone, "int", true) . ", `cellular` = " . $Str->SQL($userCellular, "int", true) . ", `url` = " . $Str->SQL($userURL, "", true) . ", `icq` = " . $Str->SQL($userICQ, "int", true) . ", `msn` = " . $Str->SQL($userMSN, "", true) . ", `clan` = " . $Str->SQL($userClan, "", true) . ", `description` = " . $Str->SQL($userDescription, "", true) . ($uSendMail ? ", `email` = LOWER(" . $Str->SQL($userEmail) . "), `status` = 'pre-user'" : "") . ", `added` = `added` WHERE `id` = " . $Str->SQL($uid, "int"));
} else {
$check["Username"] = false;
}
} else {
$rs = $Conn->Execute("SELECT `username`, `email` FROM `users` WHERE (LOWER(`username`) = LOWER(" . $Str->SQL($accUsername) . ") OR LOWER(`email`) = LOWER(" . $Str->SQL($userEmail) . ")) AND `status` <> 'deleted'");
if (mysql_num_rows($rs) == 0) {
$Conn->Execute("INSERT INTO `users` (`username`, `password`, `name`, `address`, `zipcode`, `phone`, `cellular`, `email`, `url`, `icq`, `msn`, `clan`, `description`, `status`, `added`) VALUES (" . $Str->SQL($accUsername) . ", MD5(" . $Str->SQL($accPassword) . "), " . $Str->SQL($userName) . ", " . $Str->SQL($userAddress) . ", " . $Str->SQL($userZipcode, "int") . ", " . $Str->SQL($userPhone, "int", true) . ", " . $Str->SQL($userCellular, "int", true) . ", LOWER(" . $Str->SQL($userEmail) . "), " . $Str->SQL($userURL, "", true) . ", " . $Str->SQL($userICQ, "int", true) . ", " . $Str->SQL($userMSN, "str", true) . ", " . $Str->SQL($userClan, "", true) . ", " . $Str->SQL($userDescription, "", true) . ", 'pre-user', NOW())");
$uid = mysql_insert_id();
$uSendMail = $uSuccess = $uCreated = true;
} else {
$row = mysql_fetch_array($rs, MYSQL_ASSOC);
if (!isset($err)) $err = "";
$check["Username"] = strcasecmp($accUsername, $row["username"]);
$check["Email"] = strcasecmp($userEmail, $row["email"]);
if (!$check["Username"]) $err .= "- Det valgte <b>nick</b> er allerede i brug!<br />";
if (!$check["Email"]) $err .= "- Den valgte e-mail, er allerede benyttet med af en anden konto<br />";
}
}
if ($uSuccess) {
$Conn->Disconnect();
if ($uSendMail) {
sendConfirmMail($userEmail, $userName, $uid, $accUsername, isset($logintime) ? $logintime : "");
$_SESSION["lw_uid"] = 0;
}
header("Location: " . $_SERVER["PHP_SELF"] . "?page=" . ($uCreated ? "added" : "updated") . ($uSendMail ? "&show=mail" : ""));
exit();
}
}
}
} else if ($uid > 0) {
$Conn = new MySQLDatabase();
if ($Conn->IsConnected()) {
$rs = $Conn->Execute("SELECT `username`, `name`, `address`, `zipcode`, `born`, `phone`, `cellular`, `clan`, `email`, `url`, `icq`, `msn`, `description` FROM `users` WHERE `id` = " . $Str->SQL($uid));
if ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) {
$accUsername = $row["username"];
$userName = $row["name"];
$userAddress = $row["address"];
$userZipcode = $row["zipcode"];
$userBorn = $row["born"];
$userPhone = $row["phone"];
$userCellular = $row["cellular"];
$userClan = $row["clan"];
$userEmail = $row["email"];
$userURL = $row["url"];
$userICQ = $row["icq"];
$userMSN = $row["msn"];
$userDescription = $row["description"];
} else {
$Conn->Disconnect();
header("Location: " . $_SERVER["PHP_SELF"] . "?page=unknown");
exit();
}
}
}
designTop("Brugerprofil");
?><h1><?= ($uid > 0 ? "Ret" : "Opret") . " profil"; ?></h1>
<?
if (isset($err)) echo "<font color=\"#FF0000\">Fejl ved oprettelse:<br />" . $err . "</font><br />\n";
?><form action="<?= $_SERVER["PHP_SELF"]; ?>" method="post" name="uForm">
<table border="0" cellpadding="1" cellspacing="0" style="line-height: 15px;">
<tr>
<td colspan="2"><h2>Konto</h2></td>
</tr>
<tr valign="top">
<td width="130">Brugernavn / nick:</td>
<?
if ($uid <= 0) {
?> <td><input type="text" name="Username" value="<?= $Str->HTMLEncode($accUsername); ?>" maxlength="20"<?= chkFilledState("Username"); ?> /> *</td>
</tr>
<tr valign="top">
<td>Adgangskode:</td>
<td><input type="password" name="Password" value="" autocomplete="off"<?= chkFilledState("Password"); ?> /> *</td>
</tr>
<tr valign="top">
<td>Bekræft adgangskode:</td>
<td><input type="password" name="Password2" value="" autocomplete="off"<?= chkFilledState("Password"); ?> /> *</td>
<?
} else {
?> <td><?= $Str->HTMLEncode(getVar("SESSION", "lw_uname", $accUsername)); ?></td><?
}
?></tr>
<tr>
<td colspan="2"><h2>Profil</h2></td>
</tr>
<tr valign="top">
<td>Navn:</td>
<td><input type="text" name="Name" value="<?= $Str->HTMLEncode($userName); ?>" maxlength="100"<?= chkFilledState("Name"); ?> /> *</td>
</tr>
<tr valign="top">
<td>Adresse:</td>
<td><textarea name="Address" cols="30" rows="2"<?= chkFilledState("Address"); ?>><?= $Str->HTMLEncode($userAddress); ?></textarea> *</td>
</tr>
<tr valign="top">
<td>Postnr. / By:</td>
<td>
<input type="text" name="Zipcode" value="<?= $Str->HTMLEncode($userZipcode); ?>" size="4" maxlength="4"<?= chkFilledState("Zipcode"); ?> onchange="zipcode2city(this);" /> * <input type="text" name="City" value="" tabindex="-1" readonly />
<script language="JavaScript" type="text/javascript"><!--
function iframeReplaceURL(objName, newURL)
{
var objIFrame = document.all ? document.all[objName] : document.getElementById(objName), IFrameDoc;
if (objIFrame.contentDocument) {
// For NS6
IFrameDoc = objIFrame.contentDocument;
} else if (objIFrame.contentWindow) {
// For IE5.5 and IE6
IFrameDoc = objIFrame.contentWindow.document;
} else if (objIFrame.document) {
// For IE5
IFrameDoc = objIFrame.document;
} else {
objIFrame.src = newURL;
return true;
}
IFrameDoc.location.replace(newURL);
}
function zipcode2city(objFrom)
{
setCityName(objFrom.value.length >= 4 ? "> Indlæser by ..." : "Ukendt by");
if (objFrom.value.length >= 4)
iframeReplaceURL("ZipcodeLoader", "zipcodes.php?id=" + objFrom.value + "&func=setCityName");
}
function setCityName(newValue)
{
document.forms.uForm.City.value = newValue;
}
//--></script>
</td>
</tr>
<tr valign="top">
<td>Fødselsdag:</td>
<td><input type="text" name="Born" value="<?= $Str->HTMLEncode($userBorn); ?>" size="9" maxlength="10"<?= chkFilledState("Born"); ?> /> *</td>
</tr>
<tr valign="top">
<td>Telefon:</td>
<td><input type="text" name="Phone" value="<?= $Str->HTMLEncode($userPhone); ?>" size="9" maxlength="8" /></td>
</tr>
<tr valign="top">
<td>Mobil:</td>
<td><input type="text" name="Cellular" value="<?= $Str->HTMLEncode($userCellular); ?>" size="9" maxlength="8" /></td>
</tr>
<tr valign="top">
<td>Klan:</td>
<td><input type="text" name="Clan" value="<?= $Str->HTMLEncode($userClan); ?>" maxlength="50" /></td>
</tr>
<tr valign="top">
<td>E-mail:</td>
<td><input type="text" name="Email" value="<?= $Str->HTMLEncode($userEmail); ?>" maxlength="100"<?= chkFilledState("Email"); ?> /> *</td>
</tr>
<tr>
<td colspan="2"><h2>Andet</h2></td>
</tr>
<tr valign="top">
<td>URL:</td>
<td><input type="text" name="URL" value="<?= $Str->HTMLEncode(strlen($userURL) > 0 ? $userURL : "
http://"); ?>" maxlength="255" /></td>
</tr>
<tr valign="top">
<td>ICQ:</td>
<td><input type="text" name="ICQ" value="<?= $Str->HTMLEncode($userICQ); ?>" maxlength="15" /></td>
</tr>
<tr valign="top">
<td>MSN:</td>
<td><input type="text" name="MSN" value="<?= $Str->HTMLEncode($userMSN); ?>" maxlength="100" /></td>
</tr>
<tr valign="top">
<td>Beskrivelse:</td>
<td><textarea name="Description" cols="50" rows="5"><?= $Str->HTMLEncode($userDescription); ?></textarea></td>
</tr>
<tr valign="top">
<td></td>
<td><input type="submit" name="" value="<?= ($uid > 0 ? "Gem ændringer" : "Opret"); ?>" /></td>
</tr>
<tr>
<td colspan="2">
<br />
<i>Bemærk:<br />
- Felter markeret med en * SKAL udfyldes<br />
- E-mail-feltet skal indeholde en gyldig mail, da der vil blive sendt en mail til at bekræfte din konto!</i><br />
</td>
</tr>
</table>
</form>
<iframe src="zipcodes.php?id=<?= $userZipcode ?>&func=setCityName" name="ZipcodeLoader" id="ZipcodeLoader" height="0" width="0" marginheight="0" marginwidth="0" scrolling="no" frameborder="0"></iframe>
<?
if ($uid > 0) {
?>
<form action="<?= $_SERVER["PHP_SELF"]; ?>?page=picture" method="post" enctype="multipart/form-data">
<table border="0" cellpadding="1" cellspacing="0" style="line-height: 15px;">
<tr>
<td colspan="2"><br /><br /><h1>Upload billede</h1></td>
</tr>
<tr valign="top">
<td width="130">Billede:</td>
<td><input type="file" name="userPic" value="" /></td>
</tr>
<tr valign="top">
<td></td>
<td><input type="submit" name="" value="Upload" /></td>
</tr>
</table>
</form>
<?
}
break;
}
designBottom();
?>