micuenta.php
Código PHP:
<?
$result=mysql_query ("SELECT * FROM users ORDER BY id desc",
$conexion);
echo"<h3 align=\"center\">Mi Cuenta</h3>";
echo "<table border=0 width=90%><tr>";
echo "<tr>";
echo "<td></td><td></td><td>Folio</td><td>Cuenta</td><td>Nombre Real</td><td>E-Mail</td><td>Cargo</td><td>Activa</td></tr>
</tr>";
while($row=mysql_fetch_row($result)){
echo "nick '$nick'";
echo " row '$row'";
echo " result '$result'";
echo "<tr>
<td><td><a href=\"micuenta1.php?id_misusu=$row[0]\" target=\"_parent\"> <img src=\"../img/derec.gif\" width=16 height=16 alt=\"click\" border=0 align=left></a></td>
</td><td>$row[0]</td><td>$row[1]</td><td>$row[7]</td><td>$row[3]</td><td>$row[6]</td><td>$row[8]</td></tr>";
}
echo"</table>
";
?>
micuenta1.php
Código PHP:
<?php
include('../config.php'); //incluimos el config.php que contiene los datos de la conexión a la db
srand((double)microtime()*1000000);
if( isset($form_submit))
{
//--> Datos
$r_id = trim(strip_tags($r_id));
$r_nombre = trim(strip_tags($r_nombre));
$r_pass = trim(strip_tags($r_pass));
$r_usuario = trim(strip_tags($r_usuario));
$r_mail = trim(strip_tags($r_mail));
$r_cargo = trim(strip_tags($r_cargo));
//--> Datos
$sql="select * from users where id='$row'";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs))
//$con_sql = "select * from users";
//$ret = db_query($con_sql);
//$row = db_fetch_array($ret);
$r_id = $row["id"];
$r_nombre = $row["nombre"];
$r_pass = $row["pass"];
$r_usuario = $row["nick"];
$r_mail = $row["email"];
$r_cargo = $row["rollo"];
$r_nick = $session["nick"];
theme_draw_box_open( "100%" );
include_once( "micuenta2.php" );
theme_draw_box_close();
}else{
$sql="select * from users";
$rs=mysql_query($sql);
while($fila=mysql_fetch_array($rs))
{
echo"<tr>";
echo"<td>".$fila["id"]."</td>";
echo"<td>".$fila["nombre"]."</td>";
echo"<td>".$fila["pass"]."</td>";
echo"<td>".$fila["mail"]."</td>";
echo"<td>".$fila["rollo"]."</td>";
echo"<td>".$fila["nick"]."</td>";
echo"</tr>";
}
include_once( "micuenta2.php" );
}
?>
micuenta2.php
Código PHP:
<form id="form1" name="form1" method="post" action="">
<table width="200" border="0">
<tr>
<td>Nombre:</td>
<td>
<label>
<input type="text" name="r_nombre" size="5" value="<? echo $r_nombre; ?>" />
</label> </td>
<td>Password</td>
<td><input type="text" name="r_pass" size="5" value="<? echo $r_pass; ?>" /></td>
</tr>
<tr>
<td>Usuario:</td>
<td><input type="text" name="r_usuario" size="5" value="<? echo $r_usuario; ?>" /></td>
<td>e-mail</td>
<td><input type="text" name="r_mail" size="5" value="<? echo $r_mail; ?>" /></td>
</tr>
<tr>
<td>Cargo</td>
<td><input type="text" name="r_cargo" size="5" value="<? echo $r_cargo; ?>" /></td>
<td> </td>
<td><input type="hidden" name="r_id" size="5" value="<? echo $r_id; ?>" /></td>
</tr>
<tr>
<td colspan="4"><div align="center">
<input type="submit" name="submit_datos" value="Guardar Cambios" />
</div>
<label> </label>
<label></label></td>
</tr>
</table>
</form>