Location: PHPKode > projects > ArticleSetup > ArticleSetup-v1-1/upload/author/profile.php

$metatitle = "Author Profile - ";

// Initial DB Connect (Can't use header)
	$query = 'select * from authors ' 
			 ."where username ='".$_SESSION['valid_user']."'";
	$result = mysql_query($query,$connection) or die(mysql_error());
	//Create user data variables		
	$info = mysql_fetch_array($result);
	$id = $info['id'];
	$username = $info['username'];
	$password = $info['password'];
	$url = $info['url'];
	$fname = htmlspecialchars($info['fname']);
	$email = htmlspecialchars($info['email']);
	$displayname = htmlspecialchars($info['displayname']);
	$bio = addslashes($info['bio']);
	$gravatar = $info['gravatar'];
	$mailopt = $info['mailopt']; //0 == checked

// Update the settings 
if(isset($_POST['profileupdate'])) { 

	if(get_magic_quotes_gpc()) {
		$updatedisplay = $_POST['displayname'];
		$updateurl = $_POST['url'];
		$updatebio = $_POST['bio'];
	} else {
		$updatedisplay = mysql_real_escape_string($_POST['displayname']);
		$updateurl = mysql_real_escape_string($_POST['url']);
		$updatebio = mysql_real_escape_string($_POST['bio']);
	$sql = "UPDATE `authors` SET `displayname`='".$updatedisplay."', `url`='".$updateurl."', `bio`='".$updatebio."' WHERE `id`=".$id;
			$query = mysql_query($sql);
			header('Location: profile.php?profileupdate=true');

include('header.php'); ?>

<?php include('../sidebar.php'); 

// Call the top area of the author template
	$authortop = new Template("../templates/".$template."/author-top.tpl");
	// Outputs the page template!
	echo $authortop->output();


<h1>Update Your Author Profile</h1>


<!-- Confirmations -->

<?php if($_GET["profileupdate"] == "true") {
	echo '<div class="alert" style="text-align: center;"><b>Settings updated!</b></div>';

<tr><td valign="top" style=" padding:0 10px 0 0px; border-right: 3px solid #F3F1E9;">
<form method="post" action="profile.php">
<table><tr><td style="width:150px;">Pen Name:</td>
<td><input type="text" name="displayname" value="<?php echo $displayname; ?>" style="width: 250px;"></td></tr>
<td><input type="text" name="url" value="<?php echo $url; ?>" style="width: 250px;"></td></tr>
<td><br/><textarea name="bio" style="width: 200px; height: 220px;"><?php echo $bio; ?></textarea></td></tr>
<tr><td colspan="2" align="center">
<br/><input type="submit" value="Update" id="submitstyle"></td></tr>
<input name="profileupdate" type="hidden" id="profileupdate" />

<td style="padding:0 0 0 20px;" valign="top">
<img style="border:2px solid #999; margin: 6px 6px 8px 0; float: left;" src="<?php echo $gravatar; ?>" /><div style="clear:both"></div>This site uses Gravatars - global avatars tied to your email address. To learn more about Gravatars, or to update your image, visit <a href="http://gravatar.com">Gravatar.com</a> and register with the email address you use to access this site. Your image will be updated across this site.</p>


<div style="clear:both; width: 100%; padding-top: 15px; border-bottom: 3px solid #F3F1E9;"></div>


// Call the bottom area of the author template
	$authorbottom = new Template("../templates/".$template."/author-bottom.tpl");
	// Outputs the page template!
	echo $authorbottom->output();

 include('../obinclude.php'); ?>
Return current item: ArticleSetup