Location: PHPKode > projects > EZphotopress > ezphotopress-1.0.0/admin/settings/manageAdminData.php
<h3><?=MANAGEADMINDATA_TITLE?></h3>
<br>
<?php
if (isset($_POST['submit']) && $_POST['submit'] == MANAGEADMINDATA_FORM_SUBMIT) {
	$password = $_POST['password1'];
	$password2 = $_POST['password2'];
	$username = $_POST['username'];
	
	$query = "update ".TABPREFIX."useradmin set ";
	$query .= "last_modify=NOW(),";
	$query .= "password = md5('".$password."'), ";
	$query .= "username='".$username."'";			

	$result = $db->query($query) or die("modify admin - save - problem with the database -> ");
	if ($result->sizeIDU() != -1) {
		?>
		<p class="ok"><?=MANAGEADMINDATA_SUCCESS?></p>
		<?php
	} else {
		?>
		<p class="error"><?=MANAGEADMINDATA_ERROR?></p>
		<?php
	}
} else {
	//get the user
	$result = $db->query("select * from ".TABPREFIX."useradmin limit 1");
	$row = $result->fetch();
	extract($row);
	?>
	<form action="home.php?id=admin&action=changeup" method="post" name="form_admindata" id="form_admindata">
		<fieldset>
			<div>
				<label><?=MANAGEADMINDATA_FORM_USERNAME?></label>
				<input type="text" name="username" class="form" size="25" value="<?php echo $username; ?>">
			</div>
			<div>
				<label><?=MANAGEADMINDATA_FORM_PASSWORD?></label>
				<input type="password" name="password1" id="password1" class="form" size="25" value="">
			</div>
			<div>
				<label><?=MANAGEADMINDATA_FORM_REPEAT_PASSWORD?></label>
				<input type="password" name="password2" id="password2" class="form" size="25" value="">
			</div>
			<div  style="text-align: center;">
				<input type="submit" name="submit" value="<?=MANAGEADMINDATA_FORM_SUBMIT?>" />
			</div>
		</fieldset>
	</form>
	<?php
	}
?>


Return current item: EZphotopress