elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Usando Git para manipular el directorio de trabajo, el índice y commits (segunda parte)


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 [7] 8 9 10 11
61  Programación / PHP / Re: Necesito un poco de ayuda de como hacer un login.php en: 13 Junio 2010, 16:30 pm
Yo pude hacer correr normalmente parece que el muchacho esta mas desubicado que otra cosa
62  Programación / PHP / Re: Ayuda con catalogo web! en: 13 Junio 2010, 15:54 pm
Bueno aver no me di cuenta de ese detalle lo reviso y te comunico gracias....
63  Programación / PHP / Re: Ayuda con catalogo web! en: 12 Junio 2010, 02:15 am
Bueno la verdad es que lo estoy realizando par un grupo de amigos, y como estan empezando les pidieron de esta clase y ese es el problema, haber plis que me olvide como era la parte de codigo porfavor
64  Programación / PHP / Re: login dependiendo del usuario en: 11 Junio 2010, 18:28 pm
Mira lo que yo hago es lo siguiente hace mucho tiempo que tengo este codigo no se de quien sera, ni quien lo hizo lo unico hice algunos cambios y lo uso para mis proyectos
Código
  1.  
  2. <?php require_once('../Control/conexiones/Coneccion_Apl.php'); ?>
  3. <?php
  4. if (!function_exists("GetSQLValueString")) {
  5. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  6. {
  7.  if (PHP_VERSION < 6) {
  8.    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  9.  }
  10.  
  11.  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  12.  
  13.  switch ($theType) {
  14.    case "text":
  15.      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  16.      break;    
  17.    case "long":
  18.    case "int":
  19.      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  20.      break;
  21.    case "double":
  22.      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  23.      break;
  24.    case "date":
  25.      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  26.      break;
  27.    case "defined":
  28.      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  29.      break;
  30.  }
  31.  return $theValue;
  32. }
  33. }
  34.  
  35. mysql_select_db($database_apl, $apl);
  36. $query_Apl_Login_Usuario = "SELECT * FROM usuarios ORDER BY nivel ASC";
  37. $Apl_Login_Usuario = mysql_query($query_Apl_Login_Usuario, $apl) or die(mysql_error());
  38. $row_Apl_Login_Usuario = mysql_fetch_assoc($Apl_Login_Usuario);
  39. $totalRows_Apl_Login_Usuario = mysql_num_rows($Apl_Login_Usuario);
  40. ?>
  41. <?php
  42. // *** Validate request to login to this site.
  43. if (!isset($_SESSION)) {
  44. }
  45.  
  46. $loginFormAction = $_SERVER['PHP_SELF'];
  47. if (isset($_GET['accesscheck'])) {
  48.  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
  49. }
  50.  
  51. if (isset($_POST['usuario'])) {
  52.  $loginUsername=$_POST['usuario'];
  53.  $password=$_POST['password'];
  54.  $MM_fldUserAuthorization = "nivel";
  55.  $MM_redirectLoginSuccess = "../Control/Administrador/inicio.php";
  56.  $MM_redirectLoginSuccess2 = "../Control/Socio/inicio.php";
  57.  $MM_redirectLoginSuccess3 = "../Control/Supervisor/inicio.php";
  58.  $MM_redirectLoginFailed = "index.php";
  59.  $MM_redirecttoReferrer = false;
  60.  mysql_select_db($database_apl, $apl);
  61.  
  62.  $LoginRS__query=sprintf("SELECT usuario, clave, nivel FROM usuarios WHERE usuario=%s AND clave=%s",
  63.  GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
  64.  
  65.  $LoginRS = mysql_query($LoginRS__query, $apl) or die(mysql_error());
  66.  $loginFoundUser = mysql_num_rows($LoginRS);
  67.  if ($loginFoundUser) {
  68.  
  69.    $loginStrGroup  = mysql_result($LoginRS,0,'nivel');
  70.  
  71.    //declare two session variables and assign them
  72.    $_SESSION['MM_Username'] = $loginUsername;
  73.    $_SESSION['MM_UserGroup'] = $loginStrGroup;      
  74.  
  75.    if (isset($_SESSION['PrevUrl']) && false) {
  76.      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
  77.    }
  78.       if($loginStrGroup==1) { header("Location: " . $MM_redirectLoginSuccess ); }
  79.  if($loginStrGroup==2) { header("Location: " . $MM_redirectLoginSuccess2 ); }
  80.  if($loginStrGroup==3) { header("Location: " . $MM_redirectLoginSuccess3 ); }
  81.  }
  82.  else {
  83.    header("Location: ". $MM_redirectLoginFailed );
  84.  }
  85. }
  86. ?>
  87.  

En esta linea de codigo se le da el nivel que puede acceder

 
Código
  1. $loginStrGroup  = mysql_result($LoginRS,0,'nivel');
En este caso el nivel es 0 como todo usuario puede se admite el ingreso.

Código
  1. $loginStrGroup  = mysql_result($LoginRS,[b]1[/b],'nivel');
En el caso de un admin o lo que se de se cambia el nivel

Código
  1. <?php
  2. mysql_free_result($Apl_Login_Usuario);
  3. ?>
Al final de la  pagina.

Pagina del Administrador.

Código
  1. <?php
  2. //initialize the session
  3. if (!isset($_SESSION)) {
  4. }
  5.  
  6. // ** Logout the current user. **
  7. $logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
  8. if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  9.  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
  10. }
  11.  
  12. if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  13.  //to fully log out a visitor we need to clear the session varialbles
  14.  $_SESSION['MM_Username'] = NULL;
  15.  $_SESSION['MM_UserGroup'] = NULL;
  16.  $_SESSION['PrevUrl'] = NULL;
  17.  unset($_SESSION['MM_Username']);
  18.  unset($_SESSION['MM_UserGroup']);
  19.  unset($_SESSION['PrevUrl']);
  20.  
  21.  $logoutGoTo = "../index.php";
  22.  if ($logoutGoTo) {
  23.    header("Location: $logoutGoTo");
  24.    exit;
  25.  }
  26. }
  27. ?>
  28. <?php
  29. if (!isset($_SESSION)) {
  30. }
  31. $MM_authorizedUsers = "1";
  32. $MM_donotCheckaccess = "false";
  33.  
  34. // *** Restrict Access To Page: Grant or deny access to this page
  35. function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
  36.  // For security, start by assuming the visitor is NOT authorized.
  37.  $isValid = False;
  38.  
  39.  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
  40.  // Therefore, we know that a user is NOT logged in if that Session variable is blank.
  41.  if (!empty($UserName)) {
  42.    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
  43.    // Parse the strings into arrays.
  44.    $arrUsers = Explode(",", $strUsers);
  45.    $arrGroups = Explode(",", $strGroups);
  46.    if (in_array($UserName, $arrUsers)) {
  47.      $isValid = true;
  48.    }
  49.    // Or, you may restrict access to only certain users based on their username.
  50.    if (in_array($UserGroup, $arrGroups)) {
  51.      $isValid = true;
  52.    }
  53.    if (($strUsers == "") && false) {
  54.      $isValid = true;
  55.    }
  56.  }
  57.  return $isValid;
  58. }
  59.  
  60. $MM_restrictGoTo = "../index.php";
  61. if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
  62.  $MM_qsChar = "?";
  63.  $MM_referrer = $_SERVER['PHP_SELF'];
  64.  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  65.  if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
  66.  $MM_referrer .= "?" . $QUERY_STRING;
  67.  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  68.  header("Location: ". $MM_restrictGoTo);
  69.  exit;
  70. }
  71. ?>
  72.  
  73.  

En este punto de codigo se define, cual es el nivel de acceso

Código
  1. $MM_authorizedUsers = "1";
  2. $MM_donotCheckaccess = "false";
Espero que te ayude



65  Programación / PHP / Ayuda con catalogo web! en: 11 Junio 2010, 18:12 pm

Bueno miren estoy implementando una web con un catalogo virtual, y al realizarla me tope con el siguiente problema me aparece el siguiente error, lo revise y no te que falta o sobra una llave lo revise y nada, aver si alguien me ayuda a encontrarlo gracias..
Código:
Parse error: parse error in C:\wamp\www\sistema-catalogo\index.php  on line 273


El codigo del index.php

Código
  1. <?php
  2. //Carga de datos de Conexion
  3. require("conexion.php");
  4.  
  5.  
  6. //Conexion a base de Datos SQL
  7. $link;
  8. mysql_select_db($sql_database);
  9.  
  10. //Buscando informacion del sistema de forma General
  11. $buscando_infoweb = mysql_query("select * FROM infoweb where id_infoweb=1");
  12. $infoweb = mysql_fetch_array($buscando_infoweb);
  13.  
  14. //Buscando informacion de la EMPRESA
  15. $buscando_empresa = mysql_query("select * FROM empresa where id_empresa=1");
  16. $empresa = mysql_fetch_array($buscando_empresa);
  17.  
  18. //CAPTURA DEL FORMULARIO
  19. $form_categoria = $_POST['form_categoria'];
  20. $form_producto = $_POST['form_producto'];
  21.  
  22. if($form_categoria == "si"){
  23. $enviado = "no";
  24. }else{
  25. $enviado = "si";
  26. }
  27.  
  28. ?>
  29. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  30. <html xmlns="http://www.w3.org/1999/xhtml">
  31. <head>
  32. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  33. <title><?php echo $infoweb['titulo']; ?></title>
  34. <link href="catalogo.css" rel="stylesheet" type="text/css" />
  35. </head>
  36.  
  37. <body>
  38. <div class="texto_blanco" id="cuerpo_superior">
  39. <span class="titulo_superior"><?php echo $empresa['nombre']; ?></span><br />
  40. <?php echo $infoweb['titulo']." V.".$infoweb['version'].".0"; ?><br />
  41. <br />
  42. <?php
  43. //informacion de la emrpsa
  44. echo $empresa['direccion']."<br>";
  45. echo "Telefono: ".$empresa['telefono']."<br>";
  46. echo "Fax: ".$empresa['fax']."<br>";
  47. echo $empresa['mail']."<br>";
  48. ?>
  49.  
  50. <br />
  51. </div>
  52. <div class="texto_blanco" id="cuerpo_info">
  53.  <table width="100%" border="0" cellspacing="0" cellpadding="2">
  54.    <tr>
  55.      <td width="5%"><img src="imagenes/usuarios.jpg" width="16" height="16" /></td>
  56.      <td width="42%">
  57. <?php
  58. //Sistema de Contador
  59. include("sist_contador.php");
  60. ?></td>
  61.      <td width="47%">
  62.        <div align="right">
  63.          <?php
  64. //Sistema de Contador
  65. echo date("d-m-Y");
  66. ?>
  67.      </div></td>
  68.      <td width="1%">&nbsp;</td>
  69.      <td width="5%"><div align="right"><img src="imagenes/calendar02.gif" alt="" width="16" height="16" /></div></td>
  70.    </tr>
  71.  </table>
  72. </div>
  73. <div id="cuerpo_general">
  74. <div class="texto_Negro" id="cuerpo_interior">
  75.  <form id="form1" name="form1" method="post" action="index.php"><div align="center">
  76.    <table width="100%" border="0" cellspacing="0" cellpadding="4">
  77.  
  78.        <tr>
  79.          <td colspan="2"><div align="left"><strong>BUSQUEDA DE PRODUCTOS</strong></div></td>
  80.          <td>&nbsp;</td>
  81.          <td><div align="left"><strong>Informacion General</strong></div></td>
  82.        </tr>
  83.        <tr>
  84.          <td width="16%"><div align="left">Categoria</div></td>
  85.          <td width="28%"><label>
  86.            <div align="left">
  87.              <table width="100%" border="0" cellspacing="0" cellpadding="0">
  88.                <tr>
  89.                  <td width="72%"><select name="form_categoria" class="texto_Negro" id="form_categoria">
  90.                    <option value="si" >Ofertas</option>
  91.                    <?php
  92. //Visulizando el listado del personal
  93. $buscando_cetegorias = mysql_query("select * FROM categorias order by nombre asc");
  94. while($categorias = mysql_fetch_array($buscando_cetegorias)){
  95. ?>
  96.                    <option value="<?php echo $categorias['id_categorias']; ?>" ><?php echo $categorias['nombre']; ?></option>
  97.                    <?php
  98. }
  99. ?>
  100.                  </select></td>
  101.                  <td width="28%"><div align="center"><img src="imagenes/serch.gif" width="14" height="14" /></div></td>
  102.                </tr>
  103.              </table>
  104.            </div>
  105.          </label></td>
  106.          <td width="4%">&nbsp;</td>
  107.          <td width="52%" rowspan="3" align="left" valign="top"><div align="left">En este sistema usted podra encontrar cualquier informaicon de nuestros productos ofrecidos por nuestra emrpesa.</div></td>
  108.        </tr>
  109.        <tr>
  110.          <td><div align="left">Producto</div></td>
  111.          <td><div align="left">
  112.            <label>
  113.            <input name="form_producto" type="text" class="texto_Negro" id="form_producto" size="16" />
  114.            </label>
  115.          </div></td>
  116.          <td>&nbsp;</td>
  117.          </tr>
  118.        <tr>
  119.          <td colspan="2"><div align="right">
  120.            <input name="enviado" type="hidden" id="enviado" value="si" />
  121.            <input name="button" type="submit" class="texto_Negro" id="button" value="Buscar" />
  122.          </div></td>
  123.          <td>&nbsp;</td>
  124.          </tr>
  125.      </table>
  126.    </div>
  127.  </form>
  128.  </div>
  129. <?php
  130. if($enviado == 'si'){
  131. ?>
  132. <table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
  133.  <tr>
  134.    <td>Busqueda de Productos</td>
  135.  </tr>
  136. </table>
  137.  
  138. <br />
  139. <?
  140. //Cuerpo BUSQUEDA
  141. $buscando_productos = mysql_query("select * FROM productos where nombre like '%$form_producto%' and categoria_id like '%$form_categoria%' order by precio asc");
  142. while($productos = mysql_fetch_array($buscando_productos)){
  143. ?>
  144. <table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
  145.  <tr>
  146.    <td width="29%">
  147.  
  148.  
  149.        <?php
  150. if($productos['mime'] == ""){?>
  151.    <div align="center">
  152.      Sin Imagen
  153.      </div>
  154.        <?php
  155. }else{
  156. ?>
  157.        <img src="<?php echo "ver.php?id_imagen=$productos[idproductos]"; ?>">
  158.        <?php
  159. }
  160. ?>
  161.  
  162.  
  163.      </td>
  164.    <td width="71%"><p>    <span class="texto_MiniTitulo"><strong>Producto: <?php echo $productos['nombre']; ?></strong></span><br />
  165.    Categoria:
  166. <?php
  167. $buscando_cetegorias2 = mysql_query("select * FROM categorias where id_categorias = '$productos[categoria_id]'");
  168. $categorias2 = mysql_fetch_array($buscando_cetegorias2);
  169. if($categorias2['nombre'] == ""){
  170. echo "Categoria Eliminada";
  171. }else{
  172. echo $categorias2['nombre'];
  173. }
  174. ?>
  175.          <br />
  176.        Informacion: <?php echo $productos['info']; ?><br />
  177.        <span class="texto_verde"><strong>
  178.       <?php
  179.  if($productos['precio'] != 0){
  180.  echo "Precio: $ ".$productos['precio'];
  181.  }
  182.  if($productos['precio'] != 0 && $productos['cantidad'] != 0){
  183.  echo " - ";
  184.  }
  185.  if($productos['cantidad'] != 0){
  186.  echo "Cantidad: ".$productos['cantidad'];
  187.  }
  188.  ?></strong></span></p>
  189.      </td>
  190.  </tr>
  191. </table>
  192. <br />
  193. <?
  194. }
  195.  
  196.  
  197. }else{
  198. ?>
  199. <table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
  200.  <tr>
  201.    <td>Ofertas de Productos</td>
  202.  </tr>
  203. </table>
  204.  
  205. <br />
  206. <?php
  207. //Busqueda de productos
  208. $buscando_productos = mysql_query("select * FROM productos where oferta like '1' and nombre like '%$form_producto%' order by precio asc");
  209. while($productos = mysql_fetch_array($buscando_productos)){
  210. ?>
  211.  
  212. <table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
  213.  <tr>
  214.    <td width="29%">
  215.  
  216.        <?php
  217. if($productos['mime'] == ""){?>
  218.    <div align="center">
  219.      Sin Imagen
  220.      </div>
  221.        <?php
  222. }else{
  223. ?>
  224.        <img src="<?php echo "ver.php?id_imagen=$productos[idproductos]"; ?>">
  225.        <?php
  226. }
  227. ?>
  228.  
  229.    </td>
  230.    <td width="71%"><p>    <span class="texto_MiniTitulo"><strong>Producto: <?php echo $productos['nombre']; ?></strong></span><br />
  231.    Categoria:
  232.        <?php
  233. $buscando_cetegorias2 = mysql_query("select * FROM categorias where id_categorias = '$productos[categoria_id]'");
  234. $categorias2 = mysql_fetch_array($buscando_cetegorias2);
  235. if($categorias2['nombre'] == ""){
  236. echo "Categoria Eliminada";
  237. }else{
  238. echo $categorias2['nombre'];
  239. }
  240. ?>
  241.          <br />
  242.        Informacion: <?php echo $productos['info']; ?><br />
  243.        <span class="texto_verde">
  244.        <strong>
  245.        <?php
  246.  if($productos['precio'] != 0){
  247.  echo "Precio: $ ".$productos['precio'];
  248.  }
  249.  if($productos['precio'] != 0 && $productos['cantidad'] != 0){
  250.  echo " - ";
  251.  }
  252.  if($productos['cantidad'] != 0){
  253.  echo "Cantidad: ".$productos['cantidad'];
  254.  }
  255.  ?>
  256.        </strong></span></p>
  257.      </td>
  258.  </tr>
  259. </table>
  260. <br />
  261. <?
  262. }//fin busqueda de productos
  263.  
  264.  
  265. }
  266. ?>
  267. <br />
  268. </div>
  269. <?php
  270. mysql_close($link);
  271. ?>}
  272. </body>
  273. </html>
  274.  
66  Programación / Programación Visual Basic / Re: [SRC] Elemental Multi MSN [by Elemental Code] en: 6 Junio 2010, 17:47 pm
Excelente aplicacion felicidades aunque solo le diste mejor interfaz
67  Programación / Programación Visual Basic / Re: [SRC] No Recoil Cheat v1.0 [by *PsYkE1*] en: 6 Junio 2010, 17:41 pm
Wauuuuuu  excelente programa enserio me gusto mucho yo igual lo subire a mi blogger con derechos de autor claro si me permites me agrada mucho
68  Programación / Programación Visual Basic / Software de certificados y Firmas digitales(Solucionado) en: 29 Mayo 2010, 00:02 am
Hola como estan miren tengo una duda como puedo hacer un software que pueda hacer certificados y firmas digitales.
Hasta lo que se deberia de usar.

PROTOCOLOS DE CERTIFICACIÓN

    *

      SET (Secure Electronic Transaction)
    *

      PGP (Enterprice Security)
    *

      SSL (Secure Socket Layout)

Mi duda es la siguiente si se crea un chat con ssl usando un a encriptacion estaria validado ?¿?¿?

Edito : Solucionado el problema lo hice y postee la solucion saludos

Código:
http://foro.elhacker.net/vbnet/source_firma_digital_c_2010-t296750.0.html
69  Programación / Programación Visual Basic / Re: [SOURCE]MP3 Reproductor - musicaseria.net en: 12 Mayo 2010, 17:47 pm
Muy buena la nueva Version incluso eso de la descarga me kito el  >:D sombrero hermano excelente
70  Programación / Programación Visual Basic / Re: [SOURCE]MP3 Reproductor - musicaseria.net en: 5 Mayo 2010, 21:27 pm
cHE MANITO mejor esta este codigo de maravilla
Páginas: 1 2 3 4 5 6 [7] 8 9 10 11
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines