Href link with php value
i am having a link like below
<a href="#" onclick="window.open('http://www.twitter.com/home?status=Reading+Facebook share, Yahoo Buzz and Tweet this buttons for Blogger blogs+http://www.didiknow.com');"开发者_Go百科>Tweet this</a>
i want to insert a php variable value inside for the status thing like
<a href="#" onclick="window.open('http://www.twitter.com/home?status=$markme_ddesc');">Tweet this</a>
how to do so?? please help me..
you can just echo it in there?
<?= $markme_ddesc ?>
You have several ways, for example:
<a href="#" onclick="window.open('http://www.twitter.com/home?status=<?=$markme_ddesc?>">Tweet this</a>
or
<a href="#" onclick="window.open('http://www.twitter.com/home?status=<?php print($markme_ddesc);?>">Tweet this</a>
or (in case you are within the tags)
print("<a href=\"#\" onclick=\"window.open('http://www.twitter.com/home?status=$markme_ddesc\">Tweet this</a>");
Use LIKE THIS
<a href="#" onclick="window.open('http://www.twitter.com/home?status=<?=$markme_ddesc?>">Tweet this</a>
note: status=<?=$markme_ddesc?>
精彩评论