justlukeyou Posted May 19, 2012 Share Posted May 19, 2012 Hi, I am building a website created from a database and I would like to mask the domain, can anyone advise how to do this and the best method. I have also heard that Google disliks PHP query links. This is an link, can I choose what appears in the link? <a href="product.php?price=<?php echo $row['price']; ?>&discount=<?php echo $row['discount']; ?>&description=<?php echo $row['description']; ?>&awImage=<?php echo $row['awImage']; ?>&link=<?php echo $row['link']; ?>&fulldescription=<?php echo $row['fulldescription']; ?>" class='productlink' rel="nofollow" ><?php echo $row['description']; ?></a> Quote Link to comment https://forums.phpfreaks.com/topic/262791-internal-domain-masking-php-queries/ Share on other sites More sharing options...
noXstyle Posted May 19, 2012 Share Posted May 19, 2012 Hi, Domain masking ain't the right term to use for sure. This is an link, can I choose what appears in the link? Well, you can if you change the link to a form and send the data using POST. In that case the url can be whatever you like since you're sending the mission critical data behind the curtains. Also that is one hell of a url since you send the product descriptions and stuff. Since you probably have the product data in database why not fetch it by only sending the product id? In that case you would only have to do: <a href="product.php?id=<?php echo $row['id']; ?>" class='productlink' rel="nofollow" ><?php echo $row['description']; ?></a> And you were concerned about SEO. In that case you might want to use use mod_rewrite to rewrite the urls to: product/product-name If you have unique product names you can fetch the product from database based on the name given. In real life it is rather poor implementation and i would suggest passing the id anyway. If you don't want the id to appear on url make a form and pass it via post. Hope I'm making any sense. Quote Link to comment https://forums.phpfreaks.com/topic/262791-internal-domain-masking-php-queries/#findComment-1346898 Share on other sites More sharing options...
justlukeyou Posted May 19, 2012 Author Share Posted May 19, 2012 Many thanks, I have tried getting the information using just the ID but I just cant get the information relating to the ID to echo on the final page. I have tried all sorts. I cant work out what code to use to echo the price but just inserting ID into link. <?php echo $_GET['price']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/262791-internal-domain-masking-php-queries/#findComment-1346902 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.