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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.