Ver Mensaje Individual
  #7 (permalink)  
Antiguo 27/09/2011, 10:03
Ghosty
 
Fecha de Ingreso: junio-2008
Mensajes: 292
Antigüedad: 15 años, 11 meses
Puntos: 4
Respuesta: form no ejecuta la accion

Cita:
Iniciado por mogurbon Ver Mensaje
el pex me late que podria estar en la formacion del html , convendria que pusieras los codigos de busqueda.php y buscador.php para ver donde puede estar el pdo
busqueda.php
Código PHP:
<?php
require('config.php');
require(
'include/conexion.php');
require(
'include/funciones.php');
require(
'include/pagination.class.php');

$items 20;
$page 1;

if(isset(
$_GET['page']) and is_numeric($_GET['page']) and $page $_GET['page'])
        
$limit " LIMIT ".(($page-1)*$items).",$items";
    else
        
$limit " LIMIT $items";

if(isset(
$_GET['q']) and !eregi('^ *$',$_GET['q'])){
        
$q sql_quote($_GET['q']); //para ejecutar consulta
        
$busqueda htmlentities($q); //para mostrar en pantalla

        
$sqlStr "SELECT * FROM make WHERE titulo LIKE '%$q%' OR apodo LIKE '%$q%'";
        
$sqlStrAux "SELECT count(*) as total FROM make WHERE titulo LIKE '%$q%'  OR apodo LIKE '%$q%'";
    }else{
        
$sqlStr "SELECT * FROM make";
        
$sqlStrAux "SELECT count(*) as total FROM make ";
    }

$aux Mysql_Fetch_Assoc(mysql_query($sqlStrAux,$link));
$query mysql_query($sqlStr.$limit$link);
?>    <p><?php
        
if($aux['total'] and isset($busqueda)){
                echo 
"{$aux['total']} Resultado".($aux['total']>1?'s':'')." que coinciden con tu b&uacute;squeda \"<strong>$busqueda</strong>\".";
            }elseif(
$aux['total'] and !isset($q)){
                echo 
"Videos subidos: {$aux['total']}";
            }elseif(!
$aux['total'] and isset($q)){
                echo
"No hay registros que coincidan con tu b&uacute;squeda \"<strong>$busqueda</strong>\"";
            }
    
?></p>

    <?php 
        
if($aux['total']>0){
            
$p = new pagination;
            
$p->Items($aux['total']);
            
$p->limit($items);
            if(isset(
$q))
                    
$p->target("index.php?q=".urlencode($q));
                else
                    
$p->target("index.php");
            
$p->currentPage($page);
            
$p->show();
            echo 
"\t<table width=95% border=0 cellpadding=5 cellspacing=0 class=\"registros\">\n";
            echo 
"<tr class=\"titulos\"><td width=18%></td><td width=72% align=center>Elije la maqueta que quieres promocionar</td><td width=10%></td></tr>\n";
            
$r=0;
            while(
$row mysql_fetch_assoc($query)){
          echo 
"<form action=upmaketa.php?id=".htmlentities($row['id_make'])." method=post name=form2 id=form2>
               <tr valign=baseline class=tr_lineapuntos>
                    <td bgcolor=#CBEAEF width=18% align=center valign=middle><img src= ../"
.htmlentities($row['imgd'])." width=95 height=95/></td>
                    <td bgcolor=#CBEAEF width=72% align=left valign=top class=titulo_home>"
.htmlentities($row['titulo'])."<br />
                      De: "
.htmlentities($row['apodo'])."</td>
                    <td bgcolor=#CBEAEF width=10% align=right valign=middle><input type=submit class=bt_promo value=Promo /></td>
                  </tr>
                  <tr valign=baseline class=tr_lineapuntos>
                    <td width=18% align=center valign=middle class=titulo_home>---------------------</td>
                    <td width=72% align=left valign=top class=titulo_home></td>
                    <td width=10% align=right valign=middle class=titulo_home>-----------</td>
                  </tr>
            
                
              <input type=hidden name=img value="
.htmlentities($row['imgd'])."  />
                <input type=hidden name=nombre_make value="
.htmlentities($row['id_make'])." />
              </form><br />"
;
          if(
$r%2==0)++$r;else--$r;
        }
            echo 
"\t</table>\n";
            
$p->show();
        }
    
?>

buscador.php

Código PHP:
<?php
/*
 * Buscador en AJAX. Ejemplo creado por Victor De la Rocha [http://www.mis-algoritmos.com]
 * http://www.mis-algoritmos.com/?p=169
 */
require('config.php');
require(
'include/conexion.php');
require(
'include/funciones.php');
require(
'include/pagination.class.php');

$items 10;
$page 1;

if(isset(
$_GET['page']) and is_numeric($_GET['page']) and $page $_GET['page'])
        
$limit " LIMIT ".(($page-1)*$items).",$items";
    else
        
$limit " LIMIT $items";

if(isset(
$_GET['q']) and !eregi('^ *$',$_GET['q'])){
        
$q sql_quote($_GET['q']); //para ejecutar consulta
        
$busqueda htmlentities($q); //para mostrar en pantalla

        
        
$sqlStr "SELECT * FROM make WHERE titulo LIKE '%$q%' OR apodo LIKE '%$q%'";
        
$sqlStrAux "SELECT count(*) as total FROM make WHERE titulo LIKE '%$q%'  OR apodo LIKE '%$q%'";
    }else{
        
$sqlStr "SELECT * FROM make";
        
$sqlStrAux "SELECT count(*) as total FROM make ";
    }


$aux Mysql_Fetch_Assoc(mysql_query($sqlStrAux,$link));
$query mysql_query($sqlStr.$limit$link);




?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Buscador en AJAX</title>
<link rel="stylesheet" href="pagination.css" media="screen">
<link rel="stylesheet" href="style.css" media="screen">
<script src="include/buscador.js" type="text/javascript" language="javascript"></script>
</head>

<body>
<form action="index.php" onsubmit="return buscar()">
  Aquí el nombre &gt;&gt;
    <input name="q" type="text" id="q" onKeyUp="return buscar()" value="<?php if(isset($q)) echo $busqueda;?>" size="35">
  <span id="loading"></span>
   <?php
        
if($aux['total'] and isset($busqueda)){
                echo 
"{$aux['total']} Resultado".($aux['total']>1?'s':'')." que coinciden con tu b&uacute;squeda \"<strong>$busqueda</strong>\".";
            }elseif(
$aux['total'] and !isset($q)){
                echo 
"Maquetas subidas: {$aux['total']}";
            }elseif(!
$aux['total'] and isset($q)){
                echo
"No hay registros que coincidan con tu b&uacute;squeda \"<strong>$busqueda</strong>\"";
            }
    
?>
</form>
<div id="resultados">
    <p>
      <?php 
        
if($aux['total']>0){
            
$p = new pagination;
            
$p->Items($aux['total']);
            
$p->limit($items);
            if(isset(
$q))
                    
$p->target("index.php?q=".urlencode($q));
                else
                    
$p->target("index.php");
            
$p->currentPage($page);
            
$p->show();
            echo 
"\t<table width=100% border=0 cellpadding=5 cellspacing=0  class=\"registros\">\n";
            echo 
"<tr class=\"titulos\"><td width=18%></td><td width=72% align=center>Elije la maqueta que quieres promocionar</td><td width=10%></td></tr>\n";
            
$r=0;
            while(
$row mysql_fetch_assoc($query)){
          echo 
"<form action=upmaketa.php?id=".htmlentities($row['id_make'])." method=post name=form2 id=form2>
               
                  <tr valign=baseline class=tr_lineapuntos>
                    <td bgcolor=#CBEAEF width=18% align=center valign=middle><img src= ../"
.htmlentities($row['imgd'])." width=95 height=95/></td>
                    <td bgcolor=#CBEAEF width=72% align=left valign=top class=titulo_home>"
.htmlentities($row['titulo'])."<br />
                      De: "
.htmlentities($row['apodo'])."</td>
                    <td bgcolor=#CBEAEF width=10% align=right valign=middle><input type=submit class=bt_promo value=Promo /></td>
                  </tr>
                  <tr valign=baseline class=tr_lineapuntos>
                    <td width=18% align=center valign=middle class=titulo_home>---------------------</td>
                    <td width=72% align=left valign=top class=titulo_home></td>
                    <td width=10% align=right valign=middle class=titulo_home>-----------</td>
                  </tr>
            
                
              <input type=hidden name=img value="
.htmlentities($row['imgd'])."  />
                <input type=hidden name=nombre_make value="
.htmlentities($row['id_make'])." />
              </form><br />"
;
          if(
$r%2==0)++$r;else--$r;
        }
            echo 
"\t</table>\n";
            
$p->show();
        }
    
?>
</p>
</div>
</body>
</html>