用PHP+java實(shí)現(xiàn)自動(dòng)新聞滾動(dòng)窗口
更新時(shí)間:2006年10月09日 00:00:00 作者:
show.php源代碼:
<?
if ($action=="cp"){
echo"<div align=center>
<p>滾動(dòng)菜單資料輸入端</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=重寫(xiě)>
</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 文件寫(xiě)入成功;}else{echo 寫(xiě)入失敗;}
exit;}
$wname="php-bin/data.txt";#由于是在頁(yè)面調(diào)用,這里必須填寫(xiě)頁(yè)面和程序相對(duì)路徑或者絕對(duì)路徑!
$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>";
?>
使用時(shí)先要建立一個(gè)名為data.txt的空白文件放在show.php的同一級(jí)目錄下,然后在頁(yè)面里使用include調(diào)用即可!
show.php?action=cp及可以進(jìn)行設(shè)置,當(dāng)然,因?yàn)闆](méi)有密碼保護(hù),你可以把cp改成其他文字!
<?
if ($action=="cp"){
echo"<div align=center>
<p>滾動(dòng)菜單資料輸入端</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=重寫(xiě)>
</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 文件寫(xiě)入成功;}else{echo 寫(xiě)入失敗;}
exit;}
$wname="php-bin/data.txt";#由于是在頁(yè)面調(diào)用,這里必須填寫(xiě)頁(yè)面和程序相對(duì)路徑或者絕對(duì)路徑!
$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>";
?>
使用時(shí)先要建立一個(gè)名為data.txt的空白文件放在show.php的同一級(jí)目錄下,然后在頁(yè)面里使用include調(diào)用即可!
show.php?action=cp及可以進(jìn)行設(shè)置,當(dāng)然,因?yàn)闆](méi)有密碼保護(hù),你可以把cp改成其他文字!
您可能感興趣的文章:
- 詳解如何使用Java編寫(xiě)圖形化的窗口
- 解決Java調(diào)用BAT批處理不彈出cmd窗口的方法分析
- 如何把Java程序窗口在屏幕中間顯示
- java selenium 操作彈出窗口示例代碼
- Java實(shí)現(xiàn)軟件運(yùn)行時(shí)啟動(dòng)信息窗口的方法
- Java使用組件編寫(xiě)窗口實(shí)現(xiàn)網(wǎng)絡(luò)圖片顯示
- JavaFX 監(jiān)聽(tīng)窗口關(guān)閉事件實(shí)例詳解
- Java使用組件編寫(xiě)窗口實(shí)現(xiàn)網(wǎng)上文件下載
- Java語(yǔ)言實(shí)現(xiàn)簡(jiǎn)單FTP軟件 FTP上傳下載隊(duì)列窗口實(shí)現(xiàn)(7)
- java創(chuàng)建以任意圖片為背景的窗口
相關(guān)文章
Apache, PHP在Windows 9x/NT下的安裝與配置 (一)
Apache, PHP在Windows 9x/NT下的安裝與配置 (一)...2006-10-10PHP 5 數(shù)據(jù)對(duì)象 (PDO) 抽象層與 Oracle
PHP 5 數(shù)據(jù)對(duì)象 (PDO) 抽象層與 Oracle...2006-10-10PHP4實(shí)際應(yīng)用經(jīng)驗(yàn)篇(7)
PHP4實(shí)際應(yīng)用經(jīng)驗(yàn)篇(7)...2006-10-10php入門學(xué)習(xí)知識(shí)點(diǎn)八 PHP中for循環(huán)基本應(yīng)用之九九乘法口絕表
php入門學(xué)習(xí)知識(shí)點(diǎn)八 PHP中for循環(huán)基本應(yīng)用之九九乘法口絕表,需要的朋友可以參考下。主要是掌握f(shuō)or命令的靈活運(yùn)用。2011-07-07PHP實(shí)現(xiàn)分頁(yè)的一個(gè)示例
PHP實(shí)現(xiàn)分頁(yè)的一個(gè)示例...2006-10-10一個(gè)沒(méi)有MYSQL數(shù)據(jù)庫(kù)支持的簡(jiǎn)易留言本的編寫(xiě)
一個(gè)沒(méi)有MYSQL數(shù)據(jù)庫(kù)支持的簡(jiǎn)易留言本的編寫(xiě)...2006-10-10