<?php
include_once("connect.php");
include("menu.php");
$q1 = mysql_query("select * from nickin_brugere where id = '$_GET[id]'");
$edit = mysql_fetch_array($q1);
if($edit['brugernavn'] == $_SESSION['Brugernavn']){
if($_GET['do'] == "gem"){
mysql_query("update nickin_brugere set billede = '$_POST[billede]' where id = '$_GET[id]'");
}
$edit_db = mysql_query("select * from nickin_brugere where id = '$_GET[id]'");
$edit = mysql_fetch_array($edit_db);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="post" action="editprofil.php?do=gem&id=<?php print $edit['id'] ?>">
  <p>Url til profil billede (lad feltet være blankt, hvis du ikke ønsker et profilbillede): 
    <input name="billede" type="text" id="billede" value="<?php print $edit['billede'] ?>">
  </p>
  <p>
    <input name="submit" type="submit" id="submit" value="Gem">
  </p>
</form>
</body>
</html>
<?php
}
?>