Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Search problem z szukaniem
Forum PHP.pl > Forum > PHP
Tygrys22
Plik ajax_search.php:
  1. <?php
  2.  
  3. require_once('config.php');
  4. require_once('include/functions.php');
  5.  
  6. $queryString = trim($_POST['queryString']);
  7.  
  8. // Is there a posted query string?
  9. if($queryString != '') 
  10. {
  11. $queryString = secure_sql($queryString); 
  12.  
  13. // only perform queries if the length of the search string is greather than 2 chara
    cters
  14. if(strlen($queryString) >= 3) 
  15. {
  16. $query = @mysql_query("SELECT artist, video_title, uniq_id FROM pm_videos WHERE artist LIKE '$queryString%' OR video_title LIKE '%$queryString%' LIMIT 10");
  17. if($query) 
  18. {
  19. while($result = mysql_fetch_array($query))
  20. {
  21. echo '<li onClick="fill(''.$result['artist'].' - '.$result['video_title'].'');"><a href="'.makevideolink($result['uniq_id']).'">'.$result['artist'].' - '.$result['video_title'].'</a></li>';
  22. }
  23. } 
  24. else 
  25. {
  26. echo $lang['search_results_msg3'];
  27. }
  28. }
  29. }
  30. ?>


Plik config.php
  1. <?php
  2.  
  3. //-- MySQL information --//
  4. $db_name = 'XXX'; // MySQL database name
  5. $db_user = 'XXX'; // MySQL username
  6. $db_pass = 'XXX'; // MySQL password
  7. $db_host = 'XXX';
  8.  
  9.  
  10. //-- Email server info --//
  11. XXXXXXX
  12.  
  13. XXXXXXX
  14.  
  15. // ========================================================= //
  16. //-- MySQL Backup Directory Name --//
  17. define('BKUP_DIR', 'temp'); // WITHOUT any trailing slash
  18.  
  19. header('CONTENT-TYPE: text/html; charset=utf-8');
  20. define('ABSPATH', dirname(__FILE__).'/'); // Full path to the installation folder. No need to change this.
  21. if( !file_exists('install.php') ) {
  22. require_once( ABSPATH.'include/settings.php');
  23. }
  24. ?>



I gdy chcem cos wyszukac na stronie wyskakuje mi taki oto blad:
Warning: Cannot modify header information - headers already sent by (output started at /home/nickxxxxx/domains/xxxx.pl/public_html/ajax_search.php:1) in /home/nickxxxxx/domains/xxxx.pl/public_html/config.php on line 27
Ociu
Temat wałkowany sto tysięcy siedem razy. Polecam skorzystania z szukajki.
Zamykam.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.