Hej alle eksperter!
Jeg har et lille problem som helst skal være løst, snarest muligt. Det handler om en databasefejl. Koden er her:
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN'
'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='da'>
<head>
<?php
function opdater() {
echo "<meta http-equiv='refresh' content='0; url=http://www.fixi.dk/nyt/sider/oprettet.php' />";
}
?>
<Script Language="javascript" type="text/javascript">
if( top==self){
top.location="http://www.fixi.dk/error.html"
}
</Script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="shortcut icon" href="billeder/favicon.ico">
</head>
<body>
<link rel="stylesheet" type="text/css" href="../css/css0.css">
<div id="menu">
<?php
include("inc/menu.html");
?>
<br />
<br />
<br />
<br />
<!-- password start -->
</div>
<div id="lrk">
<img src="../billeder/opret_bruger.png">
</div>
<div id="indhold">
<!-- Sidens Indhold starter -->
<p><small>... og deltag i forummet.</small></p>
<p>Udfyld alle felterne herunder</p>
<br />
<img style="height:5px;" src="../billeder/hr.gif" />
<blockquote><form action="#" method="post">
<br />
Dit fornavn<br />
<input type="text" name="naun" tabindex="1" class="yext"><br /><br />
Din alder<br />
<input type="text" name="aldeer" tabindex="2" class="yext"><br /><br />
Ønsket brugernavn<br />
<input type="text" name="oensktbr" tabindex="2" class="yext"><br /><br />
Din e-mail adresse<br />
<input type="text" name="em1" tabindex="2" style="width:100px;" class="yuxt"><span style="color:red;background-color: rgb(250,250,250);font: 14px verdana;">@</span><input style="width:100px;" type="text" name="em2" tabindex="2" class="yixt"><select name="oste" class="yoxt"><option selected="selected" value=".dk">.dk</option><option value=".com">.com</option><option value=".no">.no</option><option value=".se">.se</option><option value=".de">.de</option><option value=".eu">.eu</option><option value=".uk">.uk</option></select><br /><br />
Ønsket adgangskode<br />
<input type="password" name="aahahaa" tabindex="2" class="yext"><br /><br />
Ønsket adgangskode igen<br />
<input type="password" name="aganke" tabindex="2" class="yext"><br /><br />
<?php
{
if (isset($_POST['og'])){
if($_REQUEST['" . $_POST['aahahaa']. "'] == "" . $_POST['adganke']. "")
{
include ("inc/connector.php");
mysql_query("INSERT INTO _ff_bruerg (navn, email, brgrna, kode, pswd) VALUES ('" . $_POST['naun']. "', '" . $_POST['em1']. "@" . $_POST['em2']. "" . $_POST['oste']. "', '" . $_POST['oensktbr']. "', '" . $_POST['aganke']. "', '" . $_POST['aldeer']. "')") OR DIE(mysql_error());
opdater();
}}}
?>
<input type="submit" name="og" value="» opret" tabindex="3" class="button"><br />
</form></blockquote>
<!-- Sidens Indhold slutter -->
<center>
<?php
include("inc/fod.php");
?>
</center>
</div>
</body>
</html>
siden er her: www.fixi.dk/community/sider/opret-bruger.php
Husk at hvis i opdatere siden kommer den til forsiden, så skal i bare gå ind i opret bruger i menuen
Hilsen Benjamin
------
Fixi.dk
Fixi Community 2007
Det må vidst være her den går galt:
<?php
{
if (isset($_POST['og'])){
if($_REQUEST['" . $_POST'aahahaa']. "'] == "" . $_POST['adganke']. "")
{
include ("inc/connector.php");
mysql_query("INSERT INTO _ff_bruerg (navn, email, brgrna, kode, pswd) VALUES ('" . $_POST['naun']. "', '" . $_POST['em1']. "@" . $_POST['em2']. "" . $_POST['oste']. "', '" . $_POST['oensktbr']. "', '" . $_POST['aganke']. "', '" . $_POST['aldeer']. "')") OR DIE(mysql_error());
opdater();
}}}
?>
prøv istedet:
<?php
{
if (isset($_POST['og'])){
if($_POST'aahahaa'] == $_POST['adganke'])
{
include ("inc/connector.php");
mysql_query("INSERT INTO _ff_bruerg (navn, email, brgrna, kode, pswd) VALUES ('" . $_POST['naun']. "', '" . $_POST['em1']. "@" . $_POST['em2']. "" . $_POST['oste']. "', '" . $_POST['oensktbr']. "', '" . $_POST['aganke']. "', '" . $_POST['aldeer']. "')") OR DIE(mysql_error());
opdater();
}}}
?>