this is so weird. i still get a blank page in spite of my call to php_ini the error settings.
<?php
ini_set('log_errors', 'off');
ini_set('display_errors', 'on');
error_reporting(E_ALL);
include("include/session.php");
$_SESSION['formdata1']='';
$username = $_SESSION['username'];
include("connect.php");
// query
$sql = "SELECT * FROM client WHERE username = '".$username."'";
$result = mysql_query($sql);
// if we have rows, fetch them & prepopulate the form
if(mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
} else {
$row = array('client'=>'','organisation'=>'','address1'=>'','address2'=>'','town'=>'','postcode'=>'','telephone'=>''
,'email'=>'' ,'website'=>'','comments'=>'');
}
?>
//////////////////////////then dreamweaver template output///////
<?php
//if validate errors exists, list them out
if(isset($_SESSION['message']) && (count($_SESSION['message']) > 0)) {
echo '<ul>';
foreach($_SESSION['message'] as $message){
echo '<li>'.$message.'</li>';
}
echo '</ul>';
}
if($session->logged_in){
echo '<h1>Client details<br/>';
echo "<h1>Logged In</h1>";
echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] "
."[<a href=\"useredit.php\">Edit Account</a>] ";
echo "[<a href=\"process.php\">Logout</a>]";
echo '<strong>';
?>
<input type="hidden" name="username" value="<?=$_SESSION['username']?>" />
</strong></h1>
<form name="form1" id="form1" method="post" action="client_formhandler.php">
<table width="500" border="1">
<tr>
<td>Client name</td>';
<td><input name="client" type="text" id="client" value="<?=$row['client']?>" size="40"></td>
</tr>
<tr>
<td>Organisation</td>
<td><input name="organisation" type="text" id="organisation" value="<?=$row['organisation']?>" size="40"></td>
</tr>
<tr>
<td>Address1</td>
<td><input name="address1" type="text" id="address1" value="<?=$row['address1']?>" size="40"></td>
</tr>
<tr>
<td>Address2</td>
<td><input name="address2" type="text" id="address2" value="<?=$row['address2']?>" size="40"></td>
</tr>
<tr>
<td>Town</td>
<td><input name="town" type="text" id="town" value="<?=$row['town']?>" size="40"></td>
</tr>
<tr>
<td>Postcode</td>
<td><input name="postcode" type="text" id="postcode" value="<?=$row['postcode']?>" size="40"></td>
</tr>
<tr>
<td>Email</td>
<td><input name="email" type="text" id="email" value="<?=$row['email']?>" size="40"></td>
</tr>
<tr>
<td>Website</td>
<td><input name="website" type="text" id="website" value="<?=$row['website']?>" size="40"></td>
</tr>
<tr>
<td>Comments</td>
<td><input name="comments" type="text" id="comments" value="<?=$row['comments']?>" size="40"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Click submit </td>
<td><input type="submit" name="submit" value="submit" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<?
else {
echo '<h1>Login</h1>';
/**
* User not logged in, display the login form.
* If user has already tried to login, but errors were
* found, display the total number of errors.
* If errors occurred, they will be displayed.
*/
if($form->num_errors > 0){
echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";
}
?>
<form action="process.php" method="post">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>" /></td><td><? echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>" /></td><td><? echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?> />
<font size="2">Remember me next time
<input type="hidden" name="sublogin" value="1" />
<input type="submit" value="Login" /></td></tr>
<tr><td colspan="2" align="left"><br /><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr>
<tr><td colspan="2" align="left"><br />Not registered? <a href="register.php">Sign-Up!</a></td></tr>
</table>
</form>
<?
}
/**
* Just a little page footer, tells how many registered members
* there are, how many users currently logged in and viewing site,
* and how many guests viewing site. Active users are displayed,
* with link to their user information.
*/
echo "</td></tr><tr><td align=\"center\"><br><br>";
echo "<b>Member Total:</b> ".$database->getNumMembers()."<br>";
echo "There are $database->num_active_users registered members and ";
echo "$database->num_active_guests guests viewing the site.<br><br>";
include("include/view_active.php");
/**
* Just a little page footer, tells how many registered members
* there are, how many users currently logged in and viewing site,
* and how many guests viewing site. Active users are displayed,
* with link to their user information.
*/
echo "</td></tr><tr><td align=\"center\"><br><br>";
echo "<b>Member Total:</b> ".$database->getNumMembers()."<br>";
echo "There are $database->num_active_users registered members and ";
echo "$database->num_active_guests guests viewing the site.<br><br>";
include("include/view_active.php");
?>