用PHP+java實現(xiàn)自動新聞滾動窗口
更新時間:2006年10月09日 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";#數(shù)據(jù)保存文件,屬性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";#由于是在頁面調(diào)用,這里必須填寫頁面和程序相對路徑或者絕對路徑!
$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調(diào)用即可!
show.php?action=cp及可以進行設(shè)置,當然,因為沒有密碼保護,你可以把cp改成其他文字!
<?
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";#數(shù)據(jù)保存文件,屬性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";#由于是在頁面調(diào)用,這里必須填寫頁面和程序相對路徑或者絕對路徑!
$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調(diào)用即可!
show.php?action=cp及可以進行設(shè)置,當然,因為沒有密碼保護,你可以把cp改成其他文字!
相關(guān)文章
PHP 第二節(jié) 數(shù)據(jù)類型之數(shù)值型
編程語言的兩大功能是數(shù)據(jù)處理和流程控制;數(shù)據(jù)處理的基礎(chǔ)是數(shù)據(jù)類型和數(shù)據(jù)接口;流程控制是各種控制語句;程序的組織協(xié)調(diào)是各種編程范式;這一節(jié)先看下PHP有哪些基本的數(shù)據(jù)類型2012-04-04
PHP循環(huán)函數(shù)使用介紹之PHP基礎(chǔ)入門教程
PHP循環(huán)主要有四種:while,do…while,for,foreach。下面我們分開講解每種循環(huán)的用法2013-09-09
Centos 6.5系統(tǒng)下編譯安裝PHP 7.0.13的方法
隨著PHP 7.0對速度進行大幅度提高之后,PHP7版本也讓更多的人開始使用。所以下面這篇文章主要給大家介紹了在Centos 6.5系統(tǒng)下編譯安裝PHP 7.0.13的方法,文中通過安裝的步驟一步步介紹的非常詳細,有需要的朋友們可以參考借鑒,下面來一起看看吧。2016-12-12

