把按钮 html 到 php

startstartsvip 2011-03-26 12:29:13
原来 在页面底下 有一个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>";

...全文
97 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
startstartsvip 2011-03-26
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 life169 的回复:]

$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……
[/Quote]

多谢, 或者的 测试正确

lazyboy_wu 2011-03-26
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 life169 的回复:]

$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……
[/Quote]

+1
life169 2011-03-26
  • 打赏
  • 举报
回复
$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>";
startstartsvip 2011-03-26
  • 打赏
  • 举报
回复
嗯 还像有点错误 有button, 但onclick 每有激活
craboy1 2011-03-26
  • 打赏
  • 举报
回复

echo '<div align="right"><input type="button" onclick="export_result('.mysql_escape_string($sql_full).')" value="Export Result" /></div>';
startstartsvip 2011-03-26
  • 打赏
  • 举报
回复
就是把 第一行代码 用 echo 输出

4,251

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧