Davs..
Jeg har et ret stort problem, jeg har min side, med et community på, når man vil rette sine indstillinger gemmer filen ikke de skrevne informationer i phpmyadmin, kan nogle fortelle mig hvad der er galt?
<?php
session_start();
include("../connect.php");
if ($_SESSION['loggetind'] == "yes")
{
if($_POST[action] == "settings") {
if(empty($_POST[irlnavn])) {
echo("<script>alert('Fejlkode: Du mangler og udfylde, Irl navn!');</script><meta http-equiv=\\"refresh\\" content=\\"0;url=settings.php\\">");
}else{
if(!preg_match("/^[a-åA-Å]+$/i", $_POST['irlnavn'])) {
echo("<script>alert('Fejlkode: Irl navn må kun indholde fra A-Å!');</script><meta http-equiv=\\"refresh\\" content=\\"0;url=settings.php\\">");
}else{
(string) $fornavn = mysql_escape_string ( htmlspecialchars($_POST[fornavn]));
(string) $landsdel = mysql_escape_string ( htmlspecialchars($_POST[landsdel]));
(string) $msn = mysql_escape_string ( htmlspecialchars($_POST[msn]));
(string) $skype = mysql_escape_string ( htmlspecialchars($_POST[skype]));
(string) $hjemmeside = mysql_escape_string ( htmlspecialchars($_POST[hjemmeside]));
(string) $favting = mysql_escape_string ( htmlspecialchars($_POST[favoritting]));
(string) $favbg = mysql_escape_string ( htmlspecialchars($_POST[favoritbg]));
(string) $favrum = mysql_escape_string ( htmlspecialchars($_POST[favoritrum]));
(string) $hh = mysql_escape_string ( htmlspecialchars($_POST[hhbrugernavn]));
$profiltekst = $_POST[profiltekst];
mysql_query("UPDATE `avis_brugere` SET irlnavn = '$irlnavn', hhbrugernavn = '$hh', msn = '$msn', profiltekst = '$profiltekst', hjemmeside = '$hjemmeside', skype = '$skype', favoritting = '$favting', favoritbg = '$favbg', favoritrum = '$favrum', landsdel = '$landsdel', alder = '$_POST[dato] $_POST[maaned] $_POST[aar]' where id = '$_SESSION[ID]'") or die(mysql_error());
print "<meta http-equiv=\\"refresh\\" content=\\"0;url=showprofile.php?id=$_SESSION[ID]\\">";
}
}
}
$hent = mysql_query("SELECT * FROM `avis_brugere` where id = '$_SESSION[ID]'") or die(mysql_error());
$row = mysql_fetch_assoc($hent);
$alder = explode(' ',$row[alder]);
?>
<html>
<head>
<title>Webstationen.dk</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="da">
<meta name="title" content="Nabbonews.dk | Danmark">
<meta name="owner" content="Nikolaj J">
<meta name="Robots" CONTENT="INDEX,FOLLOW">
<meta name="language" content="dan">
<meta name="GENERATOR" content="Nabbonews.dk">
<LINK REL="Stylesheet" HREF="../stylesub.css" TYPE="text/css">
</head>
<body>
<form action="settings.php" method="POST">
<input type="hidden" name="action" value="settings">
<table style="width:100%;border: 1px solid #2D68A0;" cellpadding="2" cellspacing="0">
<tr>
<td style="text-align:center;background-image: url('../gfx/fane.gif');">
<b>Ret din profil</b>
</td>
<td style="text-align:left;background-image: url('../gfx/fane.gif');">
</td></tr>
</table>
<table style="width:100%;border-left: 1px solid #2D68A0;border-right: 1px solid #2D68A0;" cellpadding="2" cellspacing="0">
<tr>
<td style="width:10%;text-align:left;"></td>
<td style="width:30%;text-align:left;"></td>
</tr>
<tr>
<td valign="top">
<b>Irl navn:</b></td>
<td valign="top">
<input type="text" style="width:100%;height:20px;" name="irlnavn" maxlength="20" value="<?php print $row[irlnavn]; ?>">
</td></tr>
<tr>
<td valign="top">
<b>Alder:</b></td>
<td valign="top">
<select name="dato">
<?php
$dato = 1;
while($dato <= 31) {
if ($alder[0] == $dato) {
echo "<option value=\\"$dato\\" SELECTED>$dato</option>";
} else {
echo "<option value=\\"$dato\\">$dato</option>";
}
$dato++;
}
?>
</select>
<select name="maaned">
<?php
if ($alder[1] == "1") {
echo "<option value=\\"1\\" SELECTED>Januar</option>";
} else {
echo "<option value=\\"1\\">Januar</option>";
}
if ($alder[1] == "2") {
echo "<option value=\\"2\\" SELECTED>Februar</option>";
} else {
echo "<option value=\\"2\\">Februar</option>";
}
if ($alder[1] == "3") {
echo "<option value=\\"3\\" SELECTED>Marts</option>";
} else {
echo "<option value=\\"3\\">Marts</option>";
}
if ($alder[1] == "4") {
echo "<option value=\\"4\\" SELECTED>April</option>";
} else {
echo "<option value=\\"4\\">April</option>";
}
if ($alder[1] == "5") {
echo "<option value=\\"5\\" SELECTED>Maj</option>";
} else {
echo "<option value=\\"5\\">Maj</option>";
}
if ($alder[1] == "6") {
echo "<option value=\\"6\\" SELECTED>Juni</option>";
} else {
echo "<option value=\\"6\\">Juni</option>";
}
if ($alder[1] == "7") {
echo "<option value=\\"7\\" SELECTED>Juli</option>";
} else {
echo "<option value=\\"7\\">Juli</option>";
}
if ($alder[1] == "8") {
echo "<option value=\\"8\\" SELECTED>August</option>";
} else {
echo "<option value=\\"8\\">August</option>";
}
if ($alder[1] == "9") {
echo "<option value=\\"9\\" SELECTED>September</option>";
} else {
echo "<option value=\\"9\\">September</option>";
}
if ($alder[1] == "10") {
echo "<option value=\\"10\\" SELECTED>Oktober</option>";
} else {
echo "<option value=\\"10\\">Oktober</option>";
}
if ($alder[1] == "11") {
echo "<option value=\\"11\\" SELECTED>November</option>";
} else {
echo "<option value=\\"11\\">November</option>";
}
if ($alder[1] == "12") {
echo "<option value=\\"12\\" SELECTED>December</option>";
} else {
echo "<option value=\\"12\\">December</option>";
}
?>
</select>
<select name="aar">
<?php
$detteAar = date('Y');
$aar = 1956;
while($aar <= $detteAar) {
if ($alder[2] == $aar) {
echo "<option value=\\"$aar\\" SELECTED>$aar</option>";
} else {
echo "<option value=\\"$aar\\">$aar</option>";
}
$aar++;
}
?>
</select>
</td></tr>
<tr>
<td valign="top">
<b>Hjemmeside:</b></td>
<td valign="top">
<input type="text" style="width:100%;height:20px;" maxlength="60" value="<?php print $row[hjemmeside]; ?>" name="hjemmeside">
</td></tr>
<tr>
<td valign="top">
<b>Skype:</b></td>
<td valign="top">
<input type="text" style="width:100%;height:20px;" maxlength="50" value="<?php print $row[skype]; ?>" name="skype">
</td></tr>
<tr>
<td valign="top">
<b>Messenger:</b></td>
<td valign="top">
<input type="text" style="width:100%;height:20px;" maxlength="60" value="<?php print $row[msn]; ?>" name="msn">
</td></tr>
<tr>
<td valign="top">
<b>Landsdel:</b></td>
<td valign="top">
<select name="landsdel" style="width:146px;">
<option value="<?php print $row[landsdel]; ?>"><?php
if($row[landsdel] == "1") {
print "Nordjylland";
}
if($row[landsdel] == "2") {
print "Østjylland";
}
if($row[landsdel] == "3") {
print "Vestjylland";
}
if($row[landsdel] == "4") {
print "Sønderjylland";
}
if($row[landsdel] == "5") {
print "Sjælland";
}
if($row[landsdel] == "6") {
print "Fyn & Øerne";
}
if($row[landsdel] == "7") {
print "Bornholm & Øerne";
}
?></option>
<option value="<?php print $row[landsdel]; ?>">---</option>
<option value="1">Nordjylland</option>
<option value="2">Østjylland</option>
<option value="3">Vestjylland</option>
<option value="4">Sønderjylland</option>
<option value="5">Sjælland</option>
<option value="6">Fyn & Øerne</option>
<option value="7">Bornholm & Øerne</option>
</select>
</td></tr>
<tr>
<td valign="top">
<b>Favorit-ting:</b></td>
<td valign="top">
<input type="text" style="width:100%;height:20px;" value="<?php print $row[favoritting]; ?>" name="favoritting">
</td></tr>
<tr>
<td valign="top">
<b>Favorit-rum:</b></td>
<td valign="top">
<input type="text" style="width:100%;height:20px;" value="<?php print $row[favoritrum]; ?>" name="favoritrum">
</td></tr>
<tr>
<td valign="top">
<b>Favorit-bg:</b></td>
<td valign="top">
<input type="text" style="width:100%;height:20px;" value="<?php print $row[favoritbg]; ?>" name="favoritbg">
</td></tr>
<tr>
<td valign="top">
<b>HH-Brugernavn:</b></td>
<td valign="top">
<input type="text" style="width:100%;height:20px;" value="<?php print $row[hhbrugernavn]; ?>" name="hhbrugernavn">
</td></tr>
</table>
<table style="width:100%;border-bottom: 1px solid #2D68A0;border-left: 1px solid #2D68A0;border-right: 1px solid #2D68A0;" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" style="background-color: #8FB7DB;text-align:center;border-bottom: 1px solid #2D68A0;border-top: 1px solid #2D68A0;">
<b>Din profiltekst</b>
</td></tr>
<tr><td valign="top">
<textarea style="width:100%;height:300px;background:transparant;" name="profiltekst"><?php print $row[profiltekst]; ?></textarea>
</td></tr>
</table>
<input type="submit" class="submit" style="width:100%" name="submit" value="Gem ændringerne">
</form>
<iframe src="../oc.php" name="oc" style="display:none;">
</body>
</html>
<?php
}else{
print "Der er sket en fejl.";
}
?>