当前位置: 代码迷 >> PHP >> 把按钮 html 到 php解决思路
  详细解决方案

把按钮 html 到 php解决思路

热度:520   发布时间:2012-03-04 11:13:33.0
把按钮 html 到 php
原来 在页面底下 有一个button 有一下事件  

.....php 做一些处理 搞一搞 sql_full

 <div align="right"><input type="button" onclick="export_result('<?php echo mysql_escape_string($sql_full); ?>')" value="Export Result" /></div>


怎样转换为 php ? 类似:

echo "<div align='right'><input type='button' onclick='export_result('<?php echo mysql_escape_string($sql_full); ?>')' value='Export Result' /></div>";



------解决方案--------------------

echo '<div align="right"><input type="button" onclick="export_result('.mysql_escape_string($sql_full).')" value="Export Result" /></div>';
------解决方案--------------------
$sql_full = "Zaks Laptop";
echo '<div align="right"><input type="button" onclick=\'export_result("'.mysql_escape_string($sql_full).'");\' value="Export Result" /></div>';

或者:

$sql_full = "Zaks Laptop";
echo "<div align='right'><input type='button' onclick=\"export_result('".mysql_escape_string($sql_full)."');\" value='Export Result' /></div>";
------解决方案--------------------
探讨

$sql_full = "Zaks Laptop";
echo '<div align="right"><input type="button" onclick=\'export_result("'.mysql_escape_string($sql_full).'");\' value="Export Result" /></div>';

或者:

$sql_full = "Zaks……
  相关解决方案