$geturlto=rr(stripslashes($tt['news']));
$geturlto=explode(" ", $geturlto);
$geturlto=implode("-", $geturlto);
if(mb_strlen($geturlto,'UTF-8')>40){
$geturlto=mb_substr($geturlto,0, 40,'UTF-8');
}
echo $geturlto;
$lines=file('.htaccess');
foreach ($lines as $line_num => $line) {
echo $line_num.": " .$line. "<br />\n";
}
RewriteRule ^show.php?news=$geturlto
RewriteEngine On
RewriteRule ^news/([^/]+)/?$ show.php?news=$1 [QSA, L]
This webpage has a redirect loop
RewriteRule ^show/([^/"']+)/? show.php?news=$1 [L]
$title=$row['title'];
$id=$row['id'];
$title_imp=explode(" ", $title);
$title_imp=implode("-", $title_imp);
<a href='show.php?news=".$id."-".$title_imp." '>".$title."</a>
$getname=$GET['news'];
$getname=explode("-", $getname);
$id=$getname[0]; // С това правим си проверките в базата данни и вадим резултатите
<a href="<?php echo Route::ToURL(array('link', 12)); ?>">News</a>
<?php
class Route {
public static $_id;
public static function ToURL($route = ''){
$protocol = strtolower(strstr($_SERVER['SERVER_PROTOCOL'], '/', true));
$domain = $_SERVER['HTTP_HOST'];
if(isset($route) && is_array($route)){
self::$_id = $route[1];
return $protocol . '://' . $domain . '/' . $route[0];
}
}
}
class News {
public static function showId(){
return Route::$_id;
}
}
echo News::showId();
?>