gjergjkalaj Posted April 28, 2010 Share Posted April 28, 2010 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 Link to comment https://forums.phpfreaks.com/topic/200044-i-have-problem-with-search-engine-script-please-help/ Share on other sites More sharing options...
Ken2k7 Posted April 28, 2010 Share Posted April 28, 2010 So you gave aliases to mysql_query and mysql_fetch_array? That's redundant. $upit1="SELECT * FROM lajmi WHERE (lloji="ma" or lloji="p") and teksti like '%$shto%'"; Syntax error. Link to comment https://forums.phpfreaks.com/topic/200044-i-have-problem-with-search-engine-script-please-help/#findComment-1049981 Share on other sites More sharing options...
gjergjkalaj Posted April 28, 2010 Author Share Posted April 28, 2010 And how to solve this problem?! Link to comment https://forums.phpfreaks.com/topic/200044-i-have-problem-with-search-engine-script-please-help/#findComment-1049997 Share on other sites More sharing options...
Ken2k7 Posted April 28, 2010 Share Posted April 28, 2010 You really don't see the problem? The quotes around ma and p are closing the beginning quote. Link to comment https://forums.phpfreaks.com/topic/200044-i-have-problem-with-search-engine-script-please-help/#findComment-1050011 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.