根据php程序输出数据的类型选择不同的标签引入。
如:
图片 —— <img src=xxx.php>
脚本 —— <script src=xxx.php></script>
如:
图片 —— <img src=xxx.php>
脚本 —— <script src=xxx.php></script>
解决方案 »
- 关于php使用adodb5访问sqlserver2005的问题
- 救急!!~~
- 请教如何删除16位的MD5的会员记录保留32位的MD5记录的会员数据
- 今天遇到怪问题:MYSQL语句只执行了部分字段更新
- php javaScript 间的传值问题 (传数组,可以吗)
- ~~~~~~~~~~~~~~~~~~~如何把字符串中用空格分开的没字或单词放入数组中
- 招募在京奋战的php战士
- 请问这是什么意思?
- 怎样用PHP创建MYSQL数据库?
- 常见的php优化技巧总结
- LINUX下安装PHP的问题
- Warning: fopen("video_online.txt", "w") - Permission denied
根据php程序输出数据的类型选择不同的标签引入。
如:
图片 —— <img src=xxx.php>
脚本 —— <script src=xxx.php></script>
用脚本<script src=xxx.php></script>调用,好象无法实现。
<script>
document.write("<a href=http://www.100fen.com/top_stat/base.php?uid=u001 target=_blank><img width=0 height=0 src=http://www.100fen.com/top_stat/count.php?uid=u001&referURL="+escape(document.referrer)+"&curURL="+escape(document.URL)+" border=0></a>");
</script>
a.htm
<script src=xxx.php></script>xxx.php
<?php
echo "document.write('".date("Y-m-d")."');";
?>这会得到什么结果呢?
<script language="javascript" src="count.php3"></script>count.php3
<?
$memo_file="counter.txt"; /*save counternum in the boot/counter/counter.txt*/
$visits=file($memo_file); //get arry from the file
$num =$visits[0]; //get the content of the first line in the file
$num += 1;
exec("rm -rf $memo_file"); //rm old
exec("echo $num > $memo_file"); //create new
?>
document.write("<form name=counter><input type=text name=countshow size=16 style='font-size:9pt; color:#FFFF00; background-color:#000000; text-align:center; line-height:130%; border:3 ridge #00FF00' value=''></form>");
s=new Array(2);
s[0]="第 <?print($num)?> 次"
s[1]="欢迎光临"
var id,p=0;
function show(){
document.counter.countshow.value=s[p];
p=p+1;
if(p>1){
p=0
}
id=setTimeout('show()',2000);
}
show();
最后别忘了建立counter.txt文件,空文件即可
结论:正确 ,但并不是PHP正确.
原因:xxx.php输出的内容是JS格式.