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

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 7 8 9 [10] 11 12 13 14 15 16 17 18
91  Programación / PHP / Re: fatal error on boolean en: 19 Marzo 2016, 19:48 pm
si , bool = 0,1 , string = caracteres y asi
92  Programación / PHP / Re: fatal error on boolean en: 19 Marzo 2016, 19:39 pm
me sale esto ahora
Fatal error: Call to a member function fetch_object() on string in C:\xampp\htdocs\store\controllers\sales.php on line 35
93  Programación / PHP / Re: fatal error on boolean en: 19 Marzo 2016, 18:41 pm
esta e n mi funcion getLastSale
Código
  1. FUNCTION getLastSale(){
  2. $sql = "SELECT LAST_INSERT_ID() AS last";
  3. IF($this->conexion->conexion->query($sql)){
  4. RETURN TRUE;
  5. }ELSE{
  6. RETURN FALSE;
  7. }
  8. $this->conexion->conectar();
  9. }
  10.  
  11.  
94  Programación / PHP / Re: fatal error on boolean en: 19 Marzo 2016, 17:56 pm
me lanza ahora esto

bool(true)
Fatal error: Call to a member function fetch_object() on boolean in C:\xampp\htdocs\store\controllers\sales.php on line 36

si le pongo var_dump();
95  Programación / PHP / fatal error on boolean en: 19 Marzo 2016, 03:43 am
Fatal error: Call to a member function fetch_object() on boolean in C:\xampp\htdocs\store\controllers\sales.php on line 35


Código
  1. case 'save':
  2.          $sale = new Sale();
  3.          if(count($_SESSION['detalle'])>0){
  4.            $sale->saveSale();
  5.            $recordLastSale = $sale->getLastSale();
  6.            $resultLastSale = $recordLastSale->fetch_object();
  7.            $idsale = $resultLastSale->last;
  8.            foreach ($_SESSION['detalle'] as $detail):
  9.                $idproduct = $detail['idsale_detail'];
  10.                $amount = $detail['amount'] ;
  11.                $price = $detail['price'];
  12.                $subtotal = $detail['subtotal'];
  13.                if($sale->saveSaleDetail($idsale,$idproduct,$amount,$price,$subtotal)){
  14.                  echo "success";
  15.                }else{
  16.                  echo "something when wrong";
  17.                }
  18.              endforeach;
  19.              $_SESSION['detalle'] = array();  
  20.          }else{
  21.              echo "something when wrong";
  22.          }
  23.       break;
  24.  
96  Programación / Desarrollo Web / formulario desfazado al momento de darle agregar en: 1 Marzo 2016, 21:52 pm
el problema empieza cuando agrego el select se hace demasiado grande de pantalla a pantalla y no se queda en el mismo tamaño que le di estoy usando bootstrap
Código
  1. <div class="row frm-down">
  2.            <div class="form-group">
  3.                <div class="col-xs-4">
  4.                    <div>
  5.                        <select class='form-control select_product' id='select_product' name='select_product'>
  6.                            <option value="0">Select one product</option>
  7.                            <?php foreach ($row as $rows) { ?>
  8.                                <option value="<?php echo $rows['idproduct']?>"><?php echo $rows['product']?></option>
  9.                           <?php } ?>
  10.                        </select>
  11.                    </div>
  12.                </div>
  13.            </div>
  14.            <div class="form-group">
  15.                <div class="col-xs-3 frm-price">
  16.                    <input type="text" class="form-control" id="txt_amount" name="txt_amount" onkeyup="validacion('txt_amount');" placeholder="amount" maxlength="5">
  17.                </div>
  18.            </div>
  19.            <div class="col-lg-2">
  20.                <div>
  21.                    <button id="btn-add-product" class="btn btn-success btn-add-product" onclick="btn_add_product();">Add</button>
  22.                </div>
  23.            </div>
  24.        </div>
  25.  
97  Programación / PHP / Re: ayuda! pasar variable de .php a otro en: 24 Enero 2016, 06:43 am
una las injecciones sql se evitan escapando los strings y caracteres raros usa ajax para que puedas pasar las url ocultas pero igual si no te hacen sql injection esta el XSS :)
98  Programación / PHP / Error al llamar fetchObject on boolean en: 24 Enero 2016, 06:35 am
me pudieran hechar la mano ya mande el error por json para saber, imprimi el error y nada no me da que es alguien me puediera ayudar con el error

Código
  1. <?php
  2. require_once('../models/sales.php');
  3. require_once('../models/product.php');
  4. $boton=$_POST['boton'];
  5. switch ($boton) {
  6. case 'add_sale':
  7. $objProducto = new product();
  8. if (isset($_POST['producto_id']) && $_POST['producto_id']!='' && isset($_POST['cantidad']) && $_POST['cantidad']!='') {
  9. $cantidad = $_POST['cantidad'];
  10. $producto_id = $_POST['producto_id'];
  11.  
  12. $resultado_producto = $objProducto->getProductByid($producto_id);
  13. $producto = $resultado_producto->fetchObject();
  14. $descripcion = $producto->descripcion;
  15. $precio = $producto->precio;
  16.  
  17. $subtotal = $cantidad * $precio;
  18.  
  19. $_SESSION['detalle'][$producto_id] = array('id'=>$producto_id, 'producto'=>$descripcion, 'cantidad'=>$cantidad, 'precio'=>$precio, 'subtotal'=>$subtotal);
  20. }else{
  21. echo 'error';
  22. }
  23. break;
  24. }
  25. ?>
  26.  
99  Programación / PHP / Re: php variable indefinida en: 22 Enero 2016, 03:32 am
ahora si me deja acceder pero ahora query no puedo usarlo porque dice que no esta definido Fatal error: Call to undefined method PDF::query() in C:\xampp\htdocs\store\fpdf\list_product.php on line 33

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

 
Código
  1. <?php
  2. require('fpdf.php');
  3. class PDF extends FPDF{
  4. private $conexion;
  5. public function __construct(){
  6. require('../models/conexion.php');
  7. $this->conexion = new conexion();
  8. $this->conexion->conectar();
  9. }
  10. }
  11.  
  12. $pdf = new PDF();
  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. $pdf->Output();
  33. ?>
  34.  

me esta esto otro error


Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\store\fpdf\fpdf.php on line 501

Fatal error: Uncaught exception 'Exception' with message 'FPDF error: Undefined font: helvetica ' in C:\xampp\htdocs\store\fpdf\fpdf.php:271 Stack trace: #0 C:\xampp\htdocs\store\fpdf\fpdf.php(510): FPDF->Error('Undefined font:...') #1 C:\xampp\htdocs\store\fpdf\list_product.php(14): FPDF->SetFont('Arial', '', 10) #2 {main} thrown in C:\xampp\htdocs\store\fpdf\fpdf.php on line 271
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