用PHP+java实现自动新闻滚动窗口


Posted in PHP onOctober 09, 2006

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改成其他文字! 

PHP 相关文章推荐
php HtmlReplace输入过滤安全函数
Jul 03 PHP
PHP目录函数实现创建、读取目录教程实例
Jan 13 PHP
zend api扩展的php对象的autoload工具
Apr 18 PHP
深入理解php的MySQL连接类
Jun 07 PHP
php跨域cookie共享使用方法
Feb 20 PHP
PHP curl CURLOPT_RETURNTRANSFER参数的作用使用实例
Feb 07 PHP
如何解决phpmyadmin导入数据库文件最大限制2048KB
Oct 09 PHP
详解HTTP Cookie状态管理机制
Jan 14 PHP
php数组冒泡排序算法实例
May 06 PHP
Ubuntu 16.04下安装PHP 7过程详解
Mar 28 PHP
PHP操作MongoDB实现增删改查功能【附php7操作MongoDB方法】
Apr 24 PHP
php和vue配合使用技巧和方法
May 09 PHP
如何将数据从文本导入到mysql
Oct 09 #PHP
PHP个人网站架设连环讲(三)
Oct 09 #PHP
杏林同学录(九)
Oct 09 #PHP
我的论坛源代码(九)
Oct 09 #PHP
PHP个人网站架设连环讲(一)
Oct 09 #PHP
PHP个人网站架设连环讲(二)
Oct 09 #PHP
我的论坛源代码(七)
Oct 09 #PHP
You might like
PHP 判断常量,变量和函数是否存在
2009/04/26 PHP
php生成xml时添加CDATA标签的方法
2014/10/17 PHP
PHP文件上传判断file是否己选择上传文件的方法
2014/11/10 PHP
PHP设计模式之装饰器模式实例详解
2018/02/07 PHP
php-fpm.conf配置文件中文说明详解及重要参数说明
2018/10/10 PHP
Laravel如何实现自动加载类
2019/10/14 PHP
Javascript typeof 用法
2008/12/28 Javascript
jQuery的实现原理的模拟代码 -1 核心部分
2010/08/01 Javascript
JavaScript 原型继承之构造函数继承
2011/08/26 Javascript
EasyUI,点击开启编辑框,并且编辑框获得焦点的方法
2015/03/01 Javascript
微信小程序图片自适应支持多图实例详解
2017/06/21 Javascript
jQuery动画_动力节点节点Java学院整理
2017/07/04 jQuery
angularjs实现分页和搜索功能
2018/01/03 Javascript
vuex2中使用mapGetters/mapActions报错的解决方法
2018/10/20 Javascript
深入解析vue 源码目录及构建过程分析
2019/04/24 Javascript
vue swipe自定义组件实现轮播效果
2019/07/03 Javascript
vue+iview分页组件的封装
2020/11/17 Vue.js
Python实现的金山快盘的签到程序
2013/01/17 Python
详解python中 os._exit() 和 sys.exit(), exit(0)和exit(1) 的用法和区别
2017/06/23 Python
Python实现简单的语音识别系统
2017/12/13 Python
Python文件监听工具pyinotify与watchdog实例
2018/10/15 Python
Python 做曲线拟合和求积分的方法
2018/12/29 Python
Python使用到第三方库PyMuPDF图片与pdf相互转换
2019/05/03 Python
Tensorflow之MNIST CNN实现并保存、加载模型
2020/06/17 Python
浅谈Selenium 控制浏览器的常用方法
2020/12/04 Python
美国男士西装打折店:Jos. A. Bank
2017/11/13 全球购物
银行实习鉴定
2013/12/13 职场文书
国贸专业自荐信范文
2014/03/02 职场文书
幼儿园中班教师寄语
2014/04/03 职场文书
工作岗位说明书模板
2014/05/09 职场文书
课例研修方案
2014/05/31 职场文书
电影地道战观后感
2015/06/04 职场文书
《秋天的雨》教学反思
2016/02/19 职场文书
如何书写你的职业生涯规划书?
2019/06/27 职场文书
在pycharm中无法import所安装的库解决方案
2021/05/31 Python
利用python做数据拟合详情
2021/11/17 Python