• 03-04-2016, 21:27:19
    #1
    Elimdeki çalışmam bu şekilde linke tıkladığımda sayfa açıyorum ama şu şekilde ("urun-Kategori%202%20eklendi-6.html") sorunum tam olarak funcion sayfamda çalıştıramıyorum. 'self($title)' şeklinde kullandım olmadı.

    <?php
    include 'config_open_db.php'; 
    
     function self($s) {
     $tr = array('ş','Ş','ı','I','İ','ğ','Ğ','ü','Ü','ö','Ö','Ç','ç','(',')','/',':',',');
     $eng = array('s','s','i','i','i','g','g','u','u','o','o','c','c','','','-','-','');
     $s = str_replace($tr,$eng,$s);
     $s = strtolower($s);
     $s = preg_replace('/&amp;amp;amp;amp;amp;amp;amp;amp;amp;.+?;/', '', $s);
     $s = preg_replace('/\s+/', '-', $s);
     $s = preg_replace('|-+|', '-', $s);
     $s = preg_replace('/#/', '', $s);
     $s = str_replace('.', '', $s);
     $s = trim($s, '-');
     return $s;
    }
    
    $urun 	= mysql_query("select * from urunler order by id DESC");
    					while($row=mysql_fetch_array($urun)){
    					
    	$id = $row['id'];
    	$file_name = $row['resim'];
    	$title = $row['title'];
    	$aciklama = $row['aciklama'];
       
    	echo "<a href='urun-$title-$id.html'>$title</a>";
    	
     
    }
    ?>
    .htaccess im şu şekilde

    Options +FollowSymLinks
    RewriteEngine on
    
    RewriteRule urun-(.*)-(.*).html$ urundetay.php?i=$2&title=$1 [L,NC]
  • 06-04-2016, 00:26:15
    #2
    farklı sef fonksiyon denediniz mi ?