Ver Mensaje Individual
  #16 (permalink)  
Antiguo 13/03/2010, 10:19
den_22
 
Fecha de Ingreso: enero-2010
Mensajes: 198
Antigüedad: 15 años, 2 meses
Puntos: 1
Respuesta: Problema con update de perfil!

A ver digamos que lo pongo asi, quito lo de update_cuenta.php.

modificarperfil.php:

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <?php
  5. error_reporting(E_ALL ^ E_NOTICE);
  6. session_name('pLogin');
  7.  
  8.  
  9.  
  10.  
  11. $usuario = $_SESSION['usuario'];
  12.  
  13. include("function.php");
  14. include("getdata.php");
  15. include("connect.php"); //incluimos el connect.php que contiene los datos de la conexión a la db y la sesión
  16.  
  17.  
  18.  
  19.  
  20.  
  21. if(!isset($usuario)){
  22.  
  23. echo 'No se ha seleccionado ningun usuario.';
  24.  
  25. }else{
  26.  
  27. $query=mysql_query("SELECT * FROM prueba WHERE usuario='$usuario' ");
  28.  
  29. if(mysql_num_rows($query)>0){
  30.  
  31. $query=mysql_fetch_array($query);
  32. //todo comprobado, ahora solo falta mostrar los datos
  33. echo 'Bienvenid@ <b>'.$query['usuario'].'</b><br>';
  34.  
  35. }else{
  36.  
  37. echo 'El usuario seleccionado no existe';
  38.  
  39. }
  40. }
  41. ?>
  42. <?php
  43.  
  44.  
  45.  
  46. if ($action == "submit")
  47. {
  48.     mysql_query("update prueba set firstname='$firstname',lastname='$lastname' where usuario=$usuario") or mysql_error();  
  49. }
  50.  
  51. ?>
  52.  
  53.  
  54. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  55. <title>Modificar perfil|Deemo|</title>
  56. <link href="modificarperfil.css" rel="stylesheet" type="text/css" />
  57. <style type="text/css">
  58. <!--
  59. body {
  60.     background-image: url(../images/fondito.png);
  61.     background-repeat: repeat;
  62. }
  63.  
  64.  
  65. -->
  66. </style>
  67. </head>
  68.  
  69. <body>
  70. <div id="container_logo"></div>
  71. <div id="container_modify"><div id="cont_first">
  72. <div id="container_tabla">
  73. <form method="post"  action="#" >
  74.   <table width="330" border="0">
  75.     <tr>
  76.       <td width="213">Nombre de usuario:</td>
  77.       <td width="101"><input type="text" name="usuario"  id="usuario" value=" <?php echo $query[usuario];?> " /></td>
  78.     </tr>
  79.     <tr>
  80.       <td>Nombre(s):</td>
  81.       <td><input type="text" name="firstname"  id="firstname" value=" <?php echo $query[firstname];  ?> " /></td>
  82.     </tr>
  83.     <tr>
  84.       <td>Apellido:</td>
  85.       <td><input type="text" name="lastname"  id="lastname" value=" <?php echo $query[lastname];?> " /></td>
  86.     </tr>
  87.    
  88.   </table>
  89.     <div id="container_submit"> <input type="hidden" name="action"  value="submit"><input type=image height=23 alt=Save width=87 src="../images/boton_submit.gif"  border=0 name=submit>  </div>
  90.   </form>
  91.  
  92. </div>
  93.  
  94. </div>
  95. </div>
  96.  
  97.  
  98.  
  99.  
  100.  
  101. </body>
  102. </html>

Estaria bien asi?, porque no le veo el cambio