【问题标题】:Need Help button href in php echophp echo中的需要帮助按钮href
【发布时间】:2019-05-09 17:34:39
【问题描述】:
我有以下代码行:
//onclick="location.href='http://www.example.com'"
echo "<button type='button' class='single_add_to_cart_button button alt wdm_enquiry' style='background:rgb(0, 171, 0) none repeat scroll 0% 0%';>Ihre ".$post_name." Testversion anfordern!</button>";
onclick 需要包含在 echo 中,但我不能这样做。
谁能帮帮我?
【问题讨论】:
标签:
php
button
onclick
href
【解决方案1】:
你可以这样写:
echo "<button type='button' onclick=\"location.href='http://www.example.com'\" class='single_add_to_cart_button button alt wdm_enquiry' style='background:rgb(0, 171, 0) none repeat scroll 0% 0%';>Ihre $post_name Testversion anfordern!</button>";