源码网,源码论坛,源码之家,商业源码,游戏源码下载,discuz插件,棋牌源码下载,精品源码论坛

 找回密码
 立即注册
查看: 483|回复: 18

[PHP编程] 用PHP+java实现自动新闻滚动窗口

[复制链接]

7万

主题

861

回帖

32万

积分

论坛元老

Rank: 8Rank: 8

积分
329525
发表于 2006-10-9 00:00:00 | 显示全部楼层 |阅读模式
show.php源代码:
<?
if ($action=="cp"){
echo"<div align=center>
  <p>滚动菜单资料输入端</p>
  <form method=post action=show.php?action=edit>
    <p>文字一:  
      <input type=text name=t1 maxlength=30>
      链接一:
      <input type=text name=l1 maxlength=50>
    </p>
    <p>文字二:  
      <input type=text name=t2 maxlength=30>
      链接二:  
      <input type=text name=l2 maxlength=50>
    </p>
    <p>文字三:  
      <input type=text name=t3 maxlength=30>
      链接三:  
      <input type=text name=l3 maxlength=50>
    </p>
    <p>文字四:  
      <input type=text name=t4 maxlength=30>
      链接四:  
      <input type=text name=l4 maxlength=50>
    </p>
    <p>文字五:  
      <input type=text name=t5 maxlength=30>
      链接五:  
      <input type=text name=l5 maxlength=50>
    </p>
    <p>  
      <input type=submit name=Submit value=提交>
      <input type=submit name=Submit2 value=重写>
    </p>
  </form>
</div>";exit;}
if ($action=="edit"){
$wname="data.txt";#数据保存文件,属性666
$writeurl="<a href=$l1>$t1<\/a><br><br><a href=$l2>$t2<\/a><br><br><a href=$l3>$t3<\/a><br><br><a href=$l4>$t4<\/a><br><br><a href=$l5>$t5<\/a><br><br>";
$fp=fopen($wname,"w");
$ww=fputs($fp,$writeurl);
if ($ww){echo 文件写入成功;}else{echo 写入失败;}
exit;}
$wname="php-bin/data.txt";#由于是在页面调用,这里必须填写页面和程序相对路径或者绝对路径!
$fa=fopen($wname,"r+");
$wwww=fread($fa,filesize($wname));
echo "<table border= \"0\" bgcolor=\"#A8EB9B\" cellpadding=\"1\" cellspacing= \"0\" width=129><TR><TD><table bgcolor=\"#FFFFFF\" cellpadding=\"5\" cellspacing=\"0\" width=129 border=\"0\" VALIGN=\"Top\"><tr><td><script language=\"JavaScript1.2\">
var marqueewidth=118
var marqueeheight=104
var speed=1
var marqueecontents='$wwww'
if (document.all)
document.write('<marquee direction=\"up\" scrollAmount='+speed+' style=\"width:'+marqueewidth+';height:'+marqueeheight+'\">'+marqueecontents+'</marquee>')
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout(\"window.onresize=regenerate\",450)
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}
function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed
setTimeout(\"scrollit()\",100)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}
window.onload=regenerate2
</script><ilayer width=&{marqueewidth}; height=&{marqueeheight}; name=\"cmarquee01\"><layer name=\"cmarquee02\" width=&{marqueewidth}; height=&{marqueeheight};></layer></ilayer></tr></table></TD></TR></TABLE>";
?>

使用时先要建立一个名为data.txt的空白文件放在show.php的同一级目录下,然后在页面里使用include调用即可!
show.php?action=cp及可以进行设置,当然,因为没有密码保护,你可以把cp改成其他文字! 
回复

使用道具 举报

0

主题

1万

回帖

0

积分

中级会员

Rank: 3Rank: 3

积分
0
发表于 2022-8-23 11:26:47 | 显示全部楼层
这个源码不错啊
回复 支持 反对

使用道具 举报

0

主题

1万

回帖

61

积分

注册会员

Rank: 2

积分
61
发表于 2022-9-2 11:15:52 | 显示全部楼层
笑纳了老板
回复 支持 反对

使用道具 举报

4

主题

1万

回帖

107

积分

注册会员

Rank: 2

积分
107
发表于 2022-9-10 13:44:39 | 显示全部楼层
额头额定法国队是范德萨
回复 支持 反对

使用道具 举报

7

主题

1万

回帖

398

积分

中级会员

Rank: 3Rank: 3

积分
398
发表于 2022-11-17 21:34:09 | 显示全部楼层
老大你好你好好你好
回复 支持 反对

使用道具 举报

0

主题

1万

回帖

0

积分

中级会员

Rank: 3Rank: 3

积分
0
发表于 2023-4-25 19:30:51 | 显示全部楼层
管灌灌灌灌灌灌灌灌灌灌
回复 支持 反对

使用道具 举报

1

主题

1万

回帖

79

积分

注册会员

Rank: 2

积分
79
发表于 2023-6-24 02:01:11 | 显示全部楼层
儿童服务绯闻绯闻绯闻
回复 支持 反对

使用道具 举报

1

主题

1万

回帖

319

积分

中级会员

Rank: 3Rank: 3

积分
319
发表于 2023-9-10 06:11:45 | 显示全部楼层
好东西可以可以可以可以
回复 支持 反对

使用道具 举报

0

主题

1万

回帖

0

积分

中级会员

Rank: 3Rank: 3

积分
0
发表于 2023-12-7 02:04:27 | 显示全部楼层
来看看怎么样
回复 支持 反对

使用道具 举报

0

主题

1万

回帖

66

积分

注册会员

Rank: 2

积分
66
发表于 2024-4-13 17:27:22 | 显示全部楼层
收下来看看怎么样
回复 支持 反对

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

手机版|小黑屋|网站地图|源码论坛 ( 海外版 )

GMT+8, 2024-9-21 01:40 , Processed in 0.077778 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表