Ho questa porzione di codice:
Codice PHP:
if ($start>0)
{ $start_back = $start - $step;
echo "<a href=categoria.php?catID=$catID&start=$start_back> precedenti</a>";
}
$query = "SELECT count(*) AS tot FROM tblsfondi WHERE catID='$catID' ";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$pages = intval(($row[tot]-1) / $step)+1;
for ($i=0; $i<$pages AND $i<20; $i++)
{ $start_page = $i * $step;
echo "<a href=categoria.php?catID=$catID&start=$start_page> " . ($i+1) . "</a>";
}
if ($start + $step < $row[tot])
{ $start_next = $start + $step;
echo "<a href=categoria.php?catID=$catID&start=$start_next> successivi</a>";
}
Nel link
echo "<a href=categoria_sfondi.php?catID=$catID&start=$star t_page> "....
La varibile $catID corrisponde a delle categorie. Il problema è che se la categoria è composta da una parola, il link funziona, se è composta da più parole con spazi, il link si tronca.
Per esempio, con la categoria "Animali", il link diventa:
Mentre con la categoria "Cinema e televisione" il link si tronca a:
Come posso risolvere il problema?