Forum Moderators: coopster
[somesite.com...]
How do I change this to - signs?
I know this is a php topic, but hold on I'll explain...
here is my .htaccess coding which is working..
RewriteEngine on
RewriteRule ^(.+)Article([0-9]+)\.html(/)?$ articleDetail.php?id=$2&title=$1
RewriteRule ^(.+)\.html(/)?$ $1.php
and here is my php code for the urls
<a href="<?php echo stripslashes(urlencode($title));?>+Article<?php echo $id?>.html"><?php echo stripslashes($title);?>...</a>
I'm fairly sure its nothing to do with the htaccess coding... but the php coding.. which I had a friend help me with.. but he doesnt know how to fix it..
Any advise is deeply appreciated,
Regards,
here is the example of my script
<?php
$sql = "select * from jokes order by jokeid desc limit 10";
$result = mysql_query($sql ,$db);
if ($myrow = mysql_fetch_array($result)) {
do {
printf("<a href=%s/%s.php>%s</a>", $myrow["jokeid"], $myrow["joke-title"], $myrow["jokes-name"]);
} while ($myrow = mysql_fetch_array($result));
}
?>
i want to replace the jokes-title's spaces with dash, for example jokes blah blah to jokes-blah-blah
Thanks