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

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 7 8 9 10 [11] 12 13 14 15 16 17 18
101  Programación / PHP / Re: php variable indefinida en: 22 Enero 2016, 02:29 am
no puedo cambiarla ya que todo el proyecto trabaja en POO y no puedo cambiarla
102  Programación / PHP / php variable indefinida en: 22 Enero 2016, 00:48 am
hola buenas tardes en mi proyecto instale una libreria para hacer pdfs con php pero al momento de querer declarar la variable me dice variable indefinida

Código
  1. <?php
  2. require('../fpdf/fpdf.php');
  3. class PDF extends FPDF{
  4. private $conexion;
  5. public function __construct(){
  6. require('conexion.php');
  7. $this->conexion = new conexion();
  8. $this->conexion->conectar();
  9. }
  10. }
  11.  
  12. $pdf = new FPDF();
  13. $pdf->AddPage();
  14. $pdf->SetFont('Arial', '', 10);
  15. $pdf->Image('../assests/img/tienda.gif' , 10 ,8, 10 , 13,'GIF');
  16. $pdf->Cell(18, 10, '', 0);
  17. $pdf->Cell(150, 10, 'Store "Aron Imperial"', 0);
  18. $pdf->SetFont('Arial', '', 9);
  19. $pdf->Cell(50, 10, 'Hoy: '.date('d-m-Y').'', 0);
  20. $pdf->Ln(15);
  21. $pdf->SetFont('Arial', 'B', 11);
  22. $pdf->Cell(70, 8, '', 0);
  23. $pdf->Cell(100, 8, 'List product', 0);
  24. $pdf->Ln(23);
  25. $pdf->SetFont('Arial', 'B',8);
  26. $pdf->Cell(15, 8, 'Code', 0);
  27. $pdf->Cell(50, 8, 'Product', 0);
  28. $pdf->Cell(25, 8, 'Price', 0);
  29. $pdf->Cell(25, 8, 'Stock', 0);
  30. $pdf->Ln(8);
  31. $pdf->SetFont('Arial','',8);
  32. $record = $product->query("SELECT * FROM product");
  33. $pdf->Output();
  34. ?>
  35.  

los errores


Notice: Undefined variable: product in C:\xampp\htdocs\store\fpdf\list_product.php on line 32

Fatal error: Call to a member function query() on null in C:\xampp\htdocs\store\fpdf\list_product.php on line 32
103  Seguridad Informática / Seguridad / nuevo en seguridad en: 14 Enero 2016, 03:48 am
como entrarme en seguridad informatica uso kali linux y virtuales de win 7
104  Programación / PHP / ayuda con una consulta en php ya que rediseñe mi base de datos en: 14 Enero 2016, 03:31 am
cuando tenia mis tablas separadas si me agarra va bien pero al cambiarla por tablas relacionadas foreigns key  , ya no me muestra mi tabla de mis produtos

Código
  1. function searchProduct($id,$main=false,$limit=false){
  2. if($main !== false && $limit !== false){
  3. $sql="SELECT * FROM product WHERE code like '%".$id."%' or product like '%".$id."%' ORDER BY idproduct ASC LIMIT $main,$limit";
  4. }else{
  5. $sql="SELECT * FROM product WHERE code like '%".$id."%' or product like '%".$id."%' ORDER BY idproduct";
  6. }
  7. echo $sql;
  8. $this->conexion->conexion->set_charset('utf8');
  9. $result=$this->conexion->conexion->query($sql);
  10. $array = array();
  11. while($record = $result->fetch_array(MYSQL_NUM)){
  12. $array[] = $record;
  13. }
  14. return $array;
  15. $this->conexion->cerrar();
  16. }
mis tablas son estas
Código
  1. CREATE TABLE IF NOT EXISTS `product` (
  2.  `idproduct` INT(11) NOT NULL,
  3.  `code` VARCHAR(15) NOT NULL,
  4.  `product` VARCHAR(50) NOT NULL,
  5.  `price` DECIMAL(9,2) NOT NULL,
  6.  `stock` INT(11) NOT NULL
  7. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  8.  
  9. --
  10. -- Volcado de datos para la tabla `product`
  11. --
  12.  
  13. INSERT INTO `product` (`idproduct`, `code`, `product`, `price`, `stock`) VALUES
  14. (1, 'MG01', 'IPHONE 4S', '5000.00', 6),
  15. (2, 'TCL01', 'IMAC', '5000.00', 6),
  16. (3, 'ILK059', 'SAMSUNG', '5000.00', 6),
  17. (4, '4520', 'HAWEI', '5000.00', 6),
  18. (5, 'A081', 'SNOWBOARD', '5000.00', 6),
  19. (6, 'MSD01', 'SKYBOARD', '5000.00', 6),
  20. (7, 'AUR01', 'SADDS', '5000.00', 6),
  21. (8, 'SA-205', 'CCD', '5000.00', 6),
  22. (9, 'KB-1830', 'USB', '5000.00', 6),
  23. (10, 'MGa01', 'MOVIES', '5000.00', 6),
  24. (11, 'PAS48', 'KNM', '5000.00', 6),
  25. (12, 'OE86Z', 'PJAGDS', '5000.00', 6),
  26. (13, 'HVMHFV', 'ASSAD', '5000.00', 6),
  27. (14, 'AFDD', 'CXVVXC', '5000.00', 6),
  28. (15, 'DASFSDFD', 'XCXCV', '5000.00', 6);
  29.  
  30. -- --------------------------------------------------------
  31.  
  32. --
  33. -- Estructura de tabla para la tabla `purchase`
  34. --
  35.  
  36. CREATE TABLE IF NOT EXISTS `purchase` (
  37.  `idpurchase` INT(11) NOT NULL,
  38.  `user_iduser` INT(11) NOT NULL,
  39.  `user_typeuser_idtypeuser` INT(11) NOT NULL,
  40.  `product_idproduct` INT(11) NOT NULL
  41. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  42.  
  43. --
  44. -- Volcado de datos para la tabla `purchase`
  45. --
  46.  
  47. INSERT INTO `purchase` (`idpurchase`, `user_iduser`, `user_typeuser_idtypeuser`, `product_idproduct`) VALUES
  48. (1, 1, 1, 10),
  49. (2, 2, 2, 10);
  50.  
  51. ADD CONSTRAINT `fk_purchase_product1` FOREIGN KEY (`product_idproduct`) REFERENCES `product` (`idproduct`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  52.  
105  Programación / PHP / Re: ayuda multi ususario en: 8 Diciembre 2015, 03:30 am
quien me puede ayudar por favor? solo el multi usario
106  Programación / PHP / ayuda multi ususario en: 2 Diciembre 2015, 03:07 am
como puediera hacer un multi usario como me estructura que tengo necesito hacer un login de multi usario para poder hacer otra cosa pero me pudiera ayudar hacer una basica ??

archivo user
Código
  1. <?php
  2.  
  3. require_once('../Models/user.php');
  4.  
  5.  
  6. $boton=$_POST['boton'];
  7.  
  8. switch ($boton) {
  9. case 'cerrar':
  10. break;
  11. case 'login':
  12. $username = $_POST['username'];
  13. $password = $_POST['password'];
  14.  
  15. $ins = new user();
  16. $array=$ins->identification($username,$password);
  17. if ($array[0]==0)
  18. {
  19. echo '0';
  20. }
  21. else
  22. {
  23. $_SESSION['login']='YES';
  24. $_SESSION['name']=$array[1];
  25. }
  26. break;
  27. case 'show_product':
  28. $instancia = new product();
  29. echo $instancia->show_product();
  30. break;
  31.  
  32.   case 'delete_product':
  33. $code   = $_POST['code'];
  34. $delete = new product();
  35. if($delete->del($code)){
  36. echo "success";
  37. }
  38. else{
  39. echo "there is something wrong";
  40. }
  41. break;
  42. }
  43. ?>
  44.  
  45.  

usario_model.php
Código
  1. <?php
  2. class user
  3. {
  4. private $conexion;
  5. public function __construct()
  6. {
  7. require_once('conexion.php');
  8. $this->conexion= new conexion();
  9. $this->conexion->conectar();
  10. }
  11.  
  12. function identification($username,$password){
  13. $pass=md5(sha1($password));
  14. $sql="SELECT * FROM users WHERE username ='$username' && password ='$pass'";
  15. $record = $this->conexion->conexion->query($sql);
  16. if ($record->num_rows > 0) {
  17. $row=$record->fetch_array();
  18. }
  19. else{
  20. $row[0]=0;
  21. }
  22. return $row;
  23. $this->conexion->cerrar();
  24. }
  25. }
  26. ?>
  27.  
107  Programación / Desarrollo Web / tabla dinamica en JS puro sin frameworks en: 25 Octubre 2015, 22:01 pm
como puedo hacer mi codigo hacerlo dinamico  , como lo hago mediante un solo for cada ves que le doy click se vayan agregando

Código
  1. <title>form</title>
  2. </head>
  3. <tr>
  4. <th>nombre:</th>
  5. <th>cantidad:</th>
  6. <th>precio:</th>
  7. </tr>
  8. <tr>
  9. <th><input type="text" id="name" placeholder="name"/></th>
  10. <th><input type="text" id="quantity" placeholder="quantity"/></th>
  11. <th><input type="text" id="price" placeholder="price"/></th>
  12. <th><input type="button" id="btn" value="add"/></th>
  13. </tr>
  14. </thead>
  15. <tbody id="data_table">
  16. </tbody>
  17. </table>
  18. <script type="text/javascript">
  19. window.onload = function(){
  20. byId('btn').onclick = function(){
  21. var data = {
  22. name: byId('name').value,
  23. quantity: byId('quantity').value,
  24. price: byId('price').value
  25. };
  26. for(i=0;i<byTag(document,'input').length;i++){
  27. document.getElementById("data_table").innerHTML += "<tr><td>"+data['name']+"</td><td>"+data['quantity']+"</td><td>"+data['price']+"</td></tr>";
  28. }
  29. console.log(arguments);
  30. }
  31. }
  32. </script>
  33. </body>
  34. </html>
  35.  
108  Programación / PHP / Re: ayuda parte eliminar en: 25 Octubre 2015, 21:47 pm
¿?
109  Programación / PHP / Re: MySQL no me muestra el valor? Osea khé? en: 25 Octubre 2015, 21:02 pm
porque no usas la varible que asignas del password = sha1(password); asi la encriptas mas facil
110  Programación / PHP / Re: ayuda parte eliminar en: 24 Octubre 2015, 16:12 pm
como puedo hacerlo para que lo haga atraves del DOM la parte de eliminar
Páginas: 1 2 3 4 5 6 7 8 9 10 [11] 12 13 14 15 16 17 18
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines