Jump to content

I have problem with search engine script. Please help!


gjergjkalaj

Recommended Posts

In my index.php I have this, declaration of form

 

<?php
include('kerkimi2.php');
?>

 

 

 

 

<form method="post" action="kerkimi.php" name="search" class="form">

 

<input type="text" id="goo" name="goo" class="cleardefault"/>

 

<input type="submit" value="search" name="groovybtn1" class="groovybutton" />

</form>

 

 

.......

 

<?php



        $a=$_GET['a']; //Dobijanje odabrane akcije sa forme


       .
       .
       .



        switch ($a) {

		case 'kerko':    
		$goo=$_GET['goo'];
		kerkoo($goo);
		break;



            default: echo "";


       }
?>

 

 

then in kerkimi.php I have

 


<?php   
    
$goo=htmlspecialchars($_POST['goo'],ENT_QUOTES);
        
echo '<SCRIPT language=\'javascript\'>';
    echo "window.location.href = 'index.php?a=kerko&goo=$goo';";
    echo "</SCRIPT>";
    
?>


 

 

in kerkimi2.php I have

 

<?php
function Kerkimi($shto){

    include('fun_per_kerkim.php');   
    
$upit1="SELECT * FROM lajmi WHERE (lloji="ma" or lloji="p") and teksti like '%$shto%'";
	$rez1=upitUBazu($upit1);
	$br1=mysql_num_rows($rez1);
	if($br1!=0){
		shkrim1($shto);
	}else{
 		echo 'Ne baze nuk ekziston nje lajmerim i tille ';
     		

}
}
?>

and in fun_per_kerkim.php I have

 

<?php

function shkrim1($goo){

 $upit="SELECT * FROM lajmi WHERE teksti LIKE '%$goo%'";
    
    $rezultat= upitUBazu($upit);
echo "<p>";

	while($red=vratiJedanRed($rezultat)) {

                                              

		  echo html_entity_decode($red['teksti']);

	  echo "<br/>";

	  echo "<hr/>";

		  }

	  echo "</p>";

}


?>


 

 

function upitubazu is mysql_query, vratijedanred is mysql_fetch_array

 

 

THE PROBLEM IS THAT DOESN PRINT NOTHING WHEN I SEARCH

 

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.