db.php
<?
$to_secs = 120;
$dbhost = 'localhost';
$dbusername = 'explosif_dk';
$dbpasswd = 'XXXXXX';
$database_name = 'explosif_dk';
$sitepath = "
http://www.explosif.dk/_test/"; $sitename = "explosif.dk";
$adminemail = "xxxx@explosif.dk";
$connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd")
or die ("Couldn't connect to server.");
$db = mysql_select_db("$database_name", $connection)
or die("Couldn't select database.");
?>
user_edit_profile.php: (Hele svineriet)
<?php
include('db.php');
include('common.php');
if($_COOKIE['loged'] == 'yes') { //if1
if($_COOKIE['user_level'] == '2') { //if2
$sql = "SELECT * FROM users WHERE username='$_COOKIE[username]'";
$result = $db->query($sql);
while($row = $db->fetch($result)) {
$userid = $row['userid'];
$email_address = $row['email_address'];
$username = $row['username'];
$f_name = $row['f_name'];
$l_name = $row['l_name'];
$decrypted_pass = base64_decode($row['decrypted_pass']);
?>
<link href="site_files/css/clean_css_v2.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table width="600" border="0" cellpadding="0" cellspacing="0" class="nws_bar">
<tr>
<td width="566"><div align="center">Login</div></td>
</tr>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#585858" class="nws_border">
<form name=form1 method=post action=register.php>
<tr>
<td width="40"><div align="center"><img src="site_files/gfx/pil.gif" width="9" height="9"></div></td>
<td width="100">First Name</td>
<td width="460"><input name=first_name type=text class="input_field" id=\"first_name\" value=\"$first_name\"></td>
</tr>
</form>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#666666" class="nws_border">
<tr>
<td width="40"><div align="center"><img src="site_files/gfx/pil.gif" width="9" height="9"></div></td>
<td width="100">Last Name</td>
<td width="460"><input name=last_name type=text class="input_field" id=\"last_name\" value=\"$last_name\"></td>
</tr>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#585858" class="nws_border">
<tr>
<td width="40"><div align="center"><img src="site_files/gfx/pil.gif" width="9" height="9"></div></td>
<td width="100">Email Address</td>
<td width="460"><input name=email_address type=text class="input_field" id=\"email_address\" value=\"$email_address\"></td>
</tr>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#666666" class="nws_border">
<tr>
<td> </td>
<td>Username</td>
<td><input name=username type=text class="input_field" id=\"username\" value=\"$username\"></td>
</tr>
<tr>
<td width="40"><div align="center"><img src="site_files/gfx/pil.gif" width="9" height="9"></div></td>
<td width="100">Password</td>
<td width="460"><input name=password type=text class="input_field" id=\"decrypted_pass\" value=\"$decrypted_pass\"></td>
</tr>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#666666" class="nws_border">
<tr>
<td width="40" valign="top"><div align="center"></div></td>
<td width="100" valign="top">Information about you:</td>
<td width="460"><textarea name=info cols="40" rows="5" class="textfield" id=info></textarea></td>
</tr>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#585858" class="nws_border">
<tr>
<td width="40"> </td>
<td width="100"> </td>
<td width="460"><input name=Submit type=submit class="button_site" value=Update></td>
</tr>
</table>
<div align="left"></div>
<div align="center"></div></td>
</tr>
</table>
<?
}
} else {
echo "<font class=\"text\">You dont have permission to view this page.</font>";
exit();
}
} else {
echo "<font class=\"text\">You are not logged in. Please do so <a href=\"../login.php\">Here</a>.</font>";
exit();
}
?>