<form method="post" name="userform" action="user_edit.php">
<table width="100%" border="0">
<tr><td align="center" height="50" colspan="2" bgcolor="#00FF00" style="font-family:Georgia, 'Times New Roman', Times, serif; font-size:22px; color:#F00; font-weight:bold;">
Edit Your Account
</td>
</tr>
<tr><td align="center" height="31" colspan="2" >
</td>
</tr>
<tr>
<td width="60%">
<?php
include "connection.php";
$nam=$_SESSION['user_active'];
$query=mysql_query("SELECT * FROM adminlogin where name='$nam'");
$a=mysql_fetch_array($query);
?>
<div class="eu">
<table width="90%" border="0" cellpadding="10">
<tr>
<td width="217">Name</td>
<td width="8">:</td>
<td width="414"><input name="name" type="text" id="textfield2" size="50" value="<?php echo $a[name]?>" /></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><input name="email" type="text" id="textfield" size="50" value="<?php echo $a['email']?>" /></td>
</tr>
<tr>
<td>Address</td>
<td>:</td>
<td><input name="address" type="text" id="textfield3" size="50" value="<?php echo $a['alamat']?>" /></td>
</tr>
<tr>
<td>Telephone</td>
<td>:</td>
<td><input name="tlp" type="text" id="textfield4" size="50" value="<?php echo $a['tlp']?>"/></td>
</tr>
<tr>
<td>Foto</td>
<td>:</td>
<td><input name="foto" type="file" id="textfield5" size="38" value="<?php echo $a['foto']?>" /></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input name="pwd" type="text" id="textfield6" size="50" value="<?php echo $a[password]?>" /></td>
</tr>
<tr>
<td>New Password</td>
<td>:</td>
<td><input name="newpwd" type="text" id="textfield7" size="50" /></td>
</tr>
<tr>
<td>Confirm New Password</td>
<td>:</td>
<td><input name="cnewpwd" type="text" id="textfield8" size="50" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><label>
<input type="submit" name="save" id="button2" value="Edit" style="width:100px;" />
<input type="reset" name="Reset" id="button3" value="Cancel" style="width:100px;" />
</label></td>
</tr>
</table>
</div>
</td>
<td width="40%" valign="top"><div style="width:260px; height:310px; background:#FFF; padding:10px;"><img src="<?php echo $a[foto]?>" width="250" height="300" align="top" /></div></td>
</tr>
</table>
</form>
<?php
include "connection.php";
$id = $_SESSION['user_active'];
$name = $_POST['name'];
$email = $_POST['email'];
$pwd = $_POST['pwd'];
$adress = $_POST['address'];
$tlp = $_POST['tlp'];
$fileName = $_FILES['foto']['name']; //get the file name
$fileSize = $_FILES['foto']['size']; //get the size
$fileError = $_FILES['foto']['error']; //get the error when upload
if($fileSize > 0 || $fileError == 0){ //check if the file is corrupt or error
$move = move_uploaded_file($_FILES['foto']['tmp_name'], 'C:\xampp\htdocs\ricepoint\admin-rp\foto'.$fileName); //save image to the folder
if($move){
$q = "update into adminlogin VALUES('','$name','$email','$pwd','$address','$tlp','../foto/$fileName' where name=$id)"; //insert image property to database
$result = mysql_query($q);
}
?>
<frameset rows="72,*" cols="*" frameborder="NO" border="0" framespacing="0">
<frame src="menu.php" name="topFrame" noresize scrolling="no">
<frameset cols="200,*" frameborder="NO" border="0" framespacing="0">
<frame src="jam.php" name="leftFrame" scrolling="NO" noresize>
<frame src="home/index.php" name="mainFrame">
</frameset>
</frameset><noframes></noframes>
<noframes>
<body>
</body>
Setelah login ke system, maka halaman frame tersebut akan muncul.target="mainFrame"[code]
Saya menaruh menu logout di menu.php.
[code=php]
<?php
session_start();
session_destroy();
echo "<script type='text/javascript'>
alert('Anda sudah logout');
</script>";
echo "<h1>Anda sudah logout</h1>";
echo "<p><a href='login.php'>Login Kembali</a></p>";z
?>
Pertanyaan saya:<?php
session_start();
if (($_SESSION['lev'] != "admn") AND ($_SESSION['lev'] != "usr")){
?>
<form method="post" action="loginsubmit.php">
<table border="0">
<tr>
<td>Username :</td>
<td><input name="username" type="text"></td>
</tr>
<tr>
<td>Password :</td>
<td><input name="pass" type="password"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</form>
</table>
<?php
}else
echo "<h1>Anda sudah login...</h1>";
include "menu.php";
?>
mohon bantuannya...