graham23s Posted October 26, 2009 Share Posted October 26, 2009 Hi Guys, My categories on my site look like: 86-Health-%3E-Fitness.html it should be: 86-Health->-Fitness.html the funny thing is when i print it to screen it shows as > but when it's in the url it shows as: %3E I feed this into my function: <?php // LOOP OUT THE CATEGORIES $qC = "SELECT * FROM `fcs_categories` ORDER BY `category_name` ASC"; $rC = mysql_query($qC) or die (mysql_error()); // LOOP while ($aC = mysql_fetch_array($rC)) { // VARS $catID = $aC['id']; $catNM = $aC['category_name']; // Call the function $links = generate_seo_friendly_category_links($catNM, $catID); // Print the links print "<li class=\"\">$links</li>\n"; } ?> Then the function that converts to seo friendly urls function generate_seo_friendly_category_links($catNM, $catID) { // Clean up the product names $replacedNM = str_replace(" ", "-", $catNM); // Trim the white space $nameTrimmed = trim($replacedNM); // The string together $brandNewSEOFriendlyURLCat = "<a href='$catID-$nameTrimmed.html'>$catNM</a>"; return $brandNewSEOFriendlyURLCat; } is there a way the url can show the symbol > rather than the unsightly %3E thanks a lot guys Graham Link to comment https://forums.phpfreaks.com/topic/179093-html-in-url/ Share on other sites More sharing options...
Maq Posted October 26, 2009 Share Posted October 26, 2009 is there a way the url can show the symbol > rather than the unsightly %3E Why? The greater than sign is supposed to be encoded. It's not safe otherwise. There's no reason you should need to see this in the URL. Link to comment https://forums.phpfreaks.com/topic/179093-html-in-url/#findComment-944895 Share on other sites More sharing options...
JAY6390 Posted October 26, 2009 Share Posted October 26, 2009 As Maq has said, you shouldn't use it as > and your site will be read by w3validator etc as being malformed since it needs to be encoded Link to comment https://forums.phpfreaks.com/topic/179093-html-in-url/#findComment-944908 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.