Ver Mensaje Individual
  #7 (permalink)  
Antiguo 07/06/2013, 11:54
Avatar de nexus44
nexus44
 
Fecha de Ingreso: octubre-2012
Ubicación: Piura
Mensajes: 108
Antigüedad: 11 años, 6 meses
Puntos: 1
Respuesta: Eliminacion logica PHP A/D

En este codigo presento como una advertencia a eliminar . SI / NO

codigo :


borrar_confirma.php

Código PHP:
Ver original
  1. <?php require_once('Connections/con_usuarios.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.   if (PHP_VERSION < 6) {
  7.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8.   }
  9.  
  10.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12.   switch ($theType) {
  13.     case "text":
  14.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15.       break;    
  16.     case "long":
  17.     case "int":
  18.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19.       break;
  20.     case "double":
  21.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22.       break;
  23.     case "date":
  24.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25.       break;
  26.     case "defined":
  27.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28.       break;
  29.   }
  30.   return $theValue;
  31. }
  32. }
  33.  
  34. $colname_usuario = "-1";
  35. if (isset($_GET['nombre_user'])) {
  36.   $colname_usuario = $_GET['nombre_user'];
  37. }
  38. mysql_select_db($database_con_usuarios, $con_usuarios);
  39. $query_usuario = sprintf("SELECT * FROM usuarios WHERE nombre_user = %s", GetSQLValueString($colname_usuario, "text"));
  40. $usuario = mysql_query($query_usuario, $con_usuarios) or die(mysql_error());
  41. $row_usuario = mysql_fetch_assoc($usuario);
  42. $totalRows_usuario = mysql_num_rows($usuario);
  43. ?>
  44. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  45. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/base.dwt.php" codeOutsideHTMLIsLocked="false" -->
  46. <head>
  47. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  48. <!-- InstanceBeginEditable name="doctitle" -->
  49. <title>Documento sin título</title>
  50. <!-- InstanceEndEditable -->
  51. <style type="text/css">
  52. <!--
  53. body {
  54.     margin-top: 0px;
  55.     background-image: url(fondo.jpg);
  56.     background-repeat: repeat-x;
  57. }
  58. -->
  59. </style>
  60. <!-- InstanceBeginEditable name="head" -->
  61. <!-- InstanceEndEditable -->
  62. </head>
  63.  
  64. <body>
  65. <table width="80%" border="0" align="center">
  66.   <tr>
  67.     <td align="center" bgcolor="#6DC1F0"><h1>curso de control de usuarios<br />
  68.       ww.videotutoriales.es</h1></td>
  69.   </tr>
  70.   <tr>
  71.     <td align="center" bgcolor="#FFFFFF"><!-- InstanceBeginEditable name="contenido" -->
  72.       <h2>¿Seguro que desea eliminar al usuario <?php echo $row_usuario['nombre_user']; ?>?.</h2>
  73.       <p><a href="eliminar_user.php?nombre_user=<?php echo $row_usuario['nombre_user']; ?>">SI</a> / <a href="listado_users.php">NO</a></p>
  74.     <!-- InstanceEndEditable --></td>
  75.   </tr>
  76. </table>
  77. </body>
  78. <!-- InstanceEnd --></html>
  79. <?php
  80. ?>
__________________

"Nuestra capacidad se aleja de la Humanidad"