Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/02/2008, 12:12
printonic
 
Fecha de Ingreso: diciembre-2007
Mensajes: 38
Antigüedad: 17 años, 3 meses
Puntos: 0
Pasar variable de categoria a url...

Hola, estoy intentando poner dentro de la direccion la categoria en la que este el wallpaper, osea que sea variable segun la categoria

Ahora mismo lo tengo asi www.ejemplo.com/titulo/ y quiero cambiarlo

de este modo : www.ejemplo.com/categoria/titulo/


El codigo del index.php es este:

Código PHP:
//Get the name
$result mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' ORDER BY `ID` DESC LIMIT 0,9");
$x 0;
while (
$row mysql_fetch_assoc($result)) {
    
$x += 1;
    
$Recent_Wallpapers .= "\n".'<div class="Box Left"'.$string.'>'."\n\t";
        
$Recent_Wallpapers .= '<div style="font-size: 1em; margin-bottom: 5px;"><a href="'.$image_path.strtolower(str_replace(" ""-"$row['title'])).strtolower(str_replace(" ""-"$row['Title'])).'/">'.$row['Title']."</a></div>";
        
$Recent_Wallpapers .= '<div class="img-shadow"><a href="'.$image_path.'imagen/'.strtolower(str_replace(" ""-"$row['Title'])).'/"><img src="'.$image_path.'images/wallpapers/'.$row['Thumbnail'].'" alt="'.$row['Title'].'" /></a></div>';
    
$Recent_Wallpapers .= '</div>';
    if (!
is_int($x/3)){
        
$Recent_Wallpapers .= '<div class="Spacer">&nbsp;</div>';
    }
}
$Recent_Wallpapers .= '<div class="Clear"></div>';
echo 
$Recent_Wallpapers;
?> 
y llama a details.php (una parte del codigo):

Código PHP:
$website_url=str_replace('details.php',NULL,'http://www.'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']);

$pPath='/'.str_replace("/""",$_SERVER['REQUEST_URI']);

$Title str_replace("-"" "$_GET['Title']);

$Category $_GET['Category'];

include_once(
"mysql.php");

function 
curPageURL() {
 
$pageURL 'http';
 if (
$_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 
$pageURL .= "://";
 if (
$_SERVER["SERVER_PORT"] != "80") {
  
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return 
$pageURL;

Que tendria que modificar para que salga la categoria dentro? he probado a meter la variable category pero no va..y es por algo que me estoy saltando bajo mis conocimientos tan bajos.