wordpress How to add post title in link

I am using adcenter ads, which are as-

ads.ad-center.com/offer?prod=101&ref=5030200&q=Keyword

Now i want to replace Keyword in link with post title automatically. i have tried this code, but it return first word from title, code is-

<?php
 $title = get_the_title();
 echo "<a href=http://ads.ad-center-com/offer?prod=101&ref=5030200&q=$title >Download</a>"
?>

please solve it or tell me other method to add title in link automatically.
Thanks


Source: wordpress

Leave a Reply