![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
13/05/2003, 00:35
|
![Avatar de nuevo](http://static.forosdelweb.com/customavatars/avatar34159_1.gif) | | | Fecha de Ingreso: mayo-2003 Ubicación: Spain
Mensajes: 2.009
Antigüedad: 21 años, 9 meses Puntos: 2 | |
si, mira... tienes toda la razon, estaban mal varias cosas... lo deje asi y funciona bien... voy a depurarlo un poco... gracias tiu... te mereces lo mejor...
<?php
echo <<< HTML
<tr><td><div align="center"><a href="$pag?accion=modificar">Modificar</a></font></div></td></tr>
HTML;
if ($_GET['accion']=="modificar"){
require ("../config.php"); //CARGA EL CONFIG.PHP CON LOS DATOS DE LA CONEXION
$IdConexion = mysql_connect($Servidor, $Usuario,$Password) or die (mysql_error());
mysql_select_db($NombreBD, $IdConexion) or die (mysql_error());
echo <<< HTML
<form method="post" action="$PHP_SELF?accion=modificar_registros">
<table width="350" border="1" cellspacing="0" cellpadding="4" align="center">
<tr>
<td colspan="2" height="30" bgcolor="#0099FF">
<div align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"">.: Registro de Usuarios :.</font></b></div>
</td>
</tr>
<tr bgcolor="#FFFFCC">
<td width="158">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Usuario
: </font></div>
</td>
<td width="170"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<input type="text" name="postpassword" class="imputbox" maxlength="15">
</font></b></td>
</tr>
<tr bgcolor="#FFFFCC">
<td colspan="2" height="40">
<div align="center">
<input type="submit" name="Submit" value=" Registrar " class="botones" ><BR>
</div>
</td>
</tr>
</table>
HTML;
//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select postuser From $NombreTB Order By postuser";
$result=mysql_db_query($NombreBD,$sSQL) or die (mysql_error());
# Creamos la sentencia SQL y la ejecutamos.
echo '<center><select name="postuser">';
# Generamos el menu desplegable
while ($row=mysql_fetch_array($result))
{echo '<option>'.$row["postuser"];}
echo '</select>';
}
if ($_GET['accion']=="modificar_registros"){
require ("../config.php"); //CARGA EL CONFIG.PHP CON LOS DATOS DE LA CONEXION
$IdConexion = mysql_connect($Servidor, $Usuario,$Password);
mysql_select_db($NombreBD, $IdConexion) or die (mysql_error());
$sSQL="Update $NombreTB Set postpassword = '$postpassword' Where postuser = '$postuser'";
mysql_query($sSQL,$IdConexion);//nuevo
echo $sSQL;
}
?> |