- 爱易网页
-
PHP教程
- 用PHP+java实现自动新闻滚动窗口
日期:2013-02-24 浏览次数:20518 次
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(\"
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。