Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - Shell Root

#2681
PHP / Re: Doble consulta mysql..
6 Agosto 2010, 22:46 PM
Entonces sería más o menos así.
Código (sql) [Seleccionar]
SELECT Catalogo.id As 'Código', Catalogo.noArticulo As 'Código Articulo', Imagenes.rutaImagen As 'Ruta Imagen'
 FROM Catalogo
   INNER JOIN Imagenes ON Imagenes.noArticulo  = Catalogo.noArticulo
WHERE(Catalogo.id = 1)

Printea la salida que te dá esta query.
#2682
PHP / Re: Doble consulta mysql..
6 Agosto 2010, 22:28 PM
Si te fijas en el ejemplo que te deje, use el mismo campo (por el cual se relacionan las tablas), para poder identificar de cual registro es esa imagen. Lo que vos tenes no cumple con esa condición. Muestranos las estructuras de esas 2 tablas o mejor por que campo se relacionan.
#2683
PHP / Re: Doble consulta mysql..
6 Agosto 2010, 21:46 PM
Consulta sobre INNER JOIN en mysql. Por ejemplo:
Código (sql) [Seleccionar]

-- Catalogo
  -- id_catalogo, nombre_catalogo, id_imagen

-- Imagenes
  -- id_imagen, url_imagen

SELECT id_catalogo, url_imagen
 FROM Catalogo
   INNER JOIN Imagenes
     ON Imagenes.id_imagen = Catalogo.id_imagen
WHERE (id_catalogo = 1)
#2685
PHP / Re: Ayuda con script login
4 Agosto 2010, 02:30 AM
Ok, ok, sorry did not see it. Attempts to display the query and verify it within the MySQL console. For example:
Código (php) [Seleccionar]
echo "SELECT noUsuario, password FROM Usuarios WHERE noUsuario = '".$noUsuario."' AND password='".$password."'";
#2686
PHP / Re: Ayuda con script login
4 Agosto 2010, 02:03 AM
You say the password in the database is encryptada MD5, but at the time of the query in PHP, the password is not encryptada.

From MySQL query
Código (sql) [Seleccionar]
SELECT noUsuario, password
 FROM Usuarios
WHERE ((noUsuario = 'ALEX') AND (password = MD5('ALEX')));


From PHP
Código (php) [Seleccionar]

$noUsuario = 'ALEX';
$password = 'ALEX';
$password = MD5($password);
$query = mysql_query("SELECT noUsuario,password FROM Usuarios WHERE noUsuario = '".$noUsuario."' AND password='".$password."'",$link) or die(mysql_error());
#2687
@Dznp in the first code, use the elseif clause. In the second not to close the switch.

The functions are used if required to use the code on various parts of the application. Depends on what you want to do is select the method to use.
#2688
You can generate the code or you can perform a function, any option is correct and you have the same result.

The function you call anywhere, the only thing that changes is the value. As the form is refreshed when the value of the variable changes (I use the GET method), so every time you change the value of the variable, the function is executed.

For example:
Código (php) [Seleccionar]
<?php
   
function fcheck($sParameter){
      
# Function for check value of variables

      
if($sParameter == 'a'){
            return 
'The value of the variable is: <b>a</b>';
      }elseif(
$sParameter == 'b'){
         return 
'The value of the variable is: <b>b</b>';
      }else{
         return 
'The value of the variable is: <b><i>NULL</i></b>';
      }
   }
?>

<html>
<head></head>
<body>
<center><a href='index.php?Parameter=a'>a</a> | <a href='index.php?Parameter=b'>b</a></center>
<br /><br />
<?php
   
echo fcheck($_GET['Parameter']);
?>

</body>
</html>


Displays the code you have. This will help you correct it.
#2689
PHP / Re: problema en codigo :(
3 Agosto 2010, 03:46 AM
jjojo que raro a mí no me aparece ningún error.
#2690
Cita de: Skeletron en  3 Agosto 2010, 02:41 AMQueda confirmado entonces que javascript está hecho PURA Y EXCLUSIVAMENTE para realizar ataques XSS
Cita de: WikipediaXSS, del inglés Cross-site scripting es un tipo de inseguridad informática o agujero de seguridad basado en la explotación de vulnerabilidades del sistema de validación de HTML incrustado.