这些PHP代码,和JavaScript做某种结合后,网页不能正确显示的问题 当然不行!!!你把php的输出放在js脚本里,内容又不符合js语法。那怎么可以呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在 - 2 - 中修改: echo $newstype . "<br />\n"; 改为 echo "document.write(" . $newstype . ")";也不行 放在js脚本里的东西要符合js的语法 你还是先将文件 1 生成的代码是单独放到 <script language="JavaScript"> <script>中,检查代码是否符合JavaScript语法要求。 xuzuning(唠叨),能示范写一下吗? 试试echo mysql_error();换成echo "document.write(".mysql_error().");"; echo $newstype . "<br />\n"; 改为 echo "document.write(" . addslashes(str_replace("\r\n",'\r\n',$newstype)) . ")"; 不好意思echo "document.write(" . addslashes(str_replace("\r\n",'\r\n',$newstype)) . ")";换成echo "document.write(" . str_replace("\r\n",'\r\n',addslashes($str)) . ")"; u cannot write php codes in js codes,u should use php to echo the whole js function. like:<?php echo "<script language=\"javascript\">"; echo "alert(\"success!\");"; echo "</script>";?> 下面这句php代码有问题吗?怎么老是写不进数据库里去. header()函数作用 function &b(&$e),这里面的&b怎么理解呢? 这样的文本怎么存储到mysql数据库? name=\"description35\" 这是什么意思?? 新手找SMARTY环境的搭建 关于include 本地运行php 遇到文件夹不可写的问题! 有没有人使用过用imap协议实现邮件的发送和接受 一个简单的例子,但运行不了,为什么? array里的删除后和数据库里的不对应了怎么办? 2级分类查询
换成
echo "document.write(".mysql_error().");";
echo $newstype . "<br />\n";
改为
echo "document.write(" . addslashes(str_replace("\r\n",'\r\n',$newstype)) . ")";
echo "document.write(" . addslashes(str_replace("\r\n",'\r\n',$newstype)) . ")";
换成
echo "document.write(" . str_replace("\r\n",'\r\n',addslashes($str)) . ")";
<?php
echo "<script language=\"javascript\">";
echo "alert(\"success!\");";
echo "</script>";
?>