graham23s Posted April 30, 2009 Share Posted April 30, 2009 Hi Guys, I'm trying to tuen my links into SEO friendly ones, everything works fine untill: // GET THE PRODUCTS RANDOMLY AND PUT THEM IN A VARIABLE $productDisplay = "<form action='cart.php' method='POST' name='fcp-add-cart-form' /> <input type='hidden' name='fcp-cart-trigger' value='1' /> <input type='hidden' name='fcp-cart-trigger-product-id' value='$pID' /> <input type='hidden' name='fcp-cart-trigger-quantity' value='1' /> <table class='$borderColor' border='0' cellpadding='20' cellspaing='0' /> <tr> <td align='center'><img src='imgProducts/img-th/$pTH' border='0'></td><td class='fcp-product-display' align='center'>" . generate_seo_friendly_links($pNM, $pID) . "</td> </tr> <tr> <td align='center'><div class='TopSellerNumber'>£$pPR</div></td><td align='center'>$pBtn</td> </td> </tr> </table> </form>"; this bit: " . generate_seo_friendly_links($pNM, $pID) . " if i echo the product name like normal the name is displayed within the table, but when i do the above all the return values are somehow out the table, the function is: function generate_seo_friendly_links($pNM, $pID) { // Clean up the product names $replacedNM = str_replace(" ", "-", $pNM); print "<a href='$replacedNM-$pID.html'>$pNM</a>"; } i can't see how returning the URL ammended somehow throws the table out of whack thanks for any help guys Graham Quote Link to comment Share on other sites More sharing options...
graham23s Posted April 30, 2009 Author Share Posted April 30, 2009 Sorry guys fixed it, i did: function generate_seo_friendly_links($pNM, $pID) { // Clean up the product names $replacedNM = str_replace(" ", "-", $pNM); $brandNewSEOFriendlyURL = "<a href='$replacedNM-$pID.html'>$pNM</a>"; return $brandNewSEOFriendlyURL; } cheers Graham Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.