I did some major tweeking to my forum system today, and added a module for the control panel. I am going to allow basic editing.
I have error handling, and it's not throwing any errors, yet it's not updating the database when I make changes.
PHP Version
<?php
$m = $_GET['m'];
if($_SESSION) {
if(isset($_POST['submit'])) {
$query = mysql_query("UPDATE members SET password='".$_POST['password']."', email='".$_POST['email']."', icq='".$_POST['icq']."', aim='".$_POST['aim']."', msn='".$_POST['msn']."', yahoo='".$_POST['yahoo']."', home='".$_POST['home']."', password='".$_POST['job']."' WHERE name='$m'");
if (!query) {
die("Mysql Error:<br><br>".mysql_error());
}
}
include("W:/www/modulization/templates/cp_top.php");
include("W:/www/modulization/templates/cp.php");
include("W:/www/modulization/templates/cp_bottom.php");
} else {
include("W:/www/modulization/templates/cp_top.php");
include("W:/www/modulization/templates/cp_no.php");
include("W:/www/modulization/templates/cp_bottom.php");
}
?>
Template
<tr>
<form method='post' action="index.php?page=cp">
<tr>
<td class='forumcell2' width='100%' colspan='2' align='center'>Here you may update your profile information. Certain information is hidden for security purposes.</td>
</tr>
<tr>
<td class='forumcell2' width='20%'>Password</td>
<td class='forumcell2' width='80%'><input name="password" MAXLENGTH="16" value="<?=$this['password']?>"> Your password is hidden for security.</td>
</tr>
<tr>
<td class='forumcell2' width='20%'>Email</td>
<td class='forumcell2' width='80%'><input name="email" MAXLENGTH="25" value="<?=$this['email']?>"> Update your email address.</td>
</tr>
<tr>
<td class='forumcell' width='100%' colspan='2'><b>Profile Information</b></td>
</tr>
<tr>
<td class='forumcell2' width='20%'>ICQ number</td>
<td class='forumcell2' width='80%'><input name="icq" MAXLENGTH="9" value="<?=$this['icq']?>"> Update your ICQ number (9 chars or less).</td>
</tr>
<tr>
<td class='forumcell2' width='20%'>AIM Nickname</td>
<td class='forumcell2' width='80%'><input name="aim" value="<?=$this['aim']?>"> Update your AIM Nickname.</td>
</tr>
<tr>
<td class='forumcell2' width='20%'>MSN Nickname</td>
<td class='forumcell2' width='80%'><input name="msn" value="<?=$this['msn']?>"> Update your MSN Nickname.</td>
</tr>
<tr>
<td class='forumcell2' width='20%'>Yahoo Nickname</td>
<td class='forumcell2' width='80%'><input name="yahoo" value="<?=$this['yahoo']?>"> Update your Yahoo Nickname.</td>
</tr>
<tr>
<td class='forumcell2' width='20%'>Hometown</td>
<td class='forumcell2' width='80%'><input name="home" value="<?=$this['home']?>"> Update your Hometown.</td>
</tr>
<tr>
<td class='forumcell2' width='20%'>Occupation</td>
<td class='forumcell2' width='80%'><input name="job" value="<?=$this['job']?>"> Update your Occupation.</td>
</tr>
<tr>
<td colspan='2' class='forumcell' width='100%' align='center'><input type='submit' name='submit' value='Update Profile'></td>
</tr>
</form>
By the way the variable $this is an generator from a query that I generated from the _SESSION it works perfectly other places so I'm doubting it's the issue this time around.. it basically just gives "previews" of what's set in the database.