Jump to content

Diplay image from search


alexguz79

Recommended Posts

Hey people....

 

need this to work.... and after more than 20 hours... i can't... any help?

 

after the search i get results.... thats ok.... the problem comes when i try to display the image on the DDBB with that search.... just get the binary code... i also want thata image to link

 

this is my code

 

	      <?php

if( isset ($resultmsg)){
  echo $resultmsg;
  exit();
}else{
  echo "Resultados de tu búsqueda: " . $var;
}

foreach($newarr as $value){
$query_value = "SELECT * FROM perfect WHERE id = '$value'";
$num_value=mysql_query ($query_value);
$row_linkcat= mysql_fetch_array ($num_value);
$row_num_links= mysql_num_rows ($num_value);

  $titlehigh = preg_replace ( "'($var)'si" , "<b>\\1</b>" , $row_linkcat[ 'nombre_evento' ] );
  $linkhigh = preg_replace ( "'($var)'si" , "<b>\\1</b>" , $row_linkcat[ 'nombres' ] );
  $linkimg = preg_replace ( "'($var)'si" , "<b>\\1</b>" , $row_linkcat[ 'img_portada' ] );
  $contenttype = preg_replace ( "'($var)'si" , "<b>\\1</b>" , $row_linkcat[ 'FileType' ] );

foreach($trimmed_array as $trimm){
    if($trimm != 'b' ){
        $titlehigh = preg_replace( "'($trimm)'si" ,  "<b>\\1</b>" , $titlehigh);
        $linkhigh = preg_replace( "'($trimm)'si" , "<b>\\1</b>" , $linkhigh);
        $linkimg = preg_replace( "'($trimm)'si" , "<b>\\1</b>" , $linkimg);
    $contenttype = preg_replace( "'($trimm)'si" , "<b>\\1</b>" , $contenttype);
     }

?>
	    </span>
              <p> <span class="styleform">
              <?php header("Content-type:$contenttype"); ?>
		  <?php echo '<img src=' . $linkimg . ' alt="" width="100" height="70" border="0"></a>'; ?>
		  <?php echo $titlehigh; ?><br>
              <?php echo $linkhigh; ?><br><br>
              </span></p>
              <span class="styleform">
<?php
}   //end foreach $trimmed_array 
   if($row_num_links_main > $limit){

      if ($s>=1) { // do not display previous link if 's' is '0'
        $prevs=($s-$limit);
         echo "<div align='left'><a href='$PHP_SELF?s=$prevs&q=$var&catid=$catid'>Anterior " .$limit. "</a></div>";
      }

     $slimit =$s+$limit;
       if (!($slimit >= $row_num_links_main) && $row_num_links_main!=1) {

          $n=$s+$limit;
           echo "<div align='right'><a href='$PHP_SELF?s=$n&q=$var&catid=$catid'>Siguiente " .$limit. "</a></div>";
        }
    }
}  
?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/101564-diplay-image-from-search/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.