Using Php+java to implement automatic News scrolling window

Source: Internet
Author: User
show.php Source code:
?
if ($action = = "CP") {
echo "<div align=center>
<p> scrolling menu Data Input </p>
<form Method=post action=show.php?action=edit>
<p> Text One:
<input Type=text name=t1 maxlength=30>
Link One:
<input Type=text name=l1 maxlength=50>
</p>
<p> Text Two:
<input Type=text name=t2 maxlength=30>
Link two:
<input Type=text name=l2 maxlength=50>
</p>
<p> Text Three:
<input Type=text name=t3 maxlength=30>
Link Three:
<input Type=text Name=l3 maxlength=50>
</p>
<p> text Four:
<input Type=text Name=t4 maxlength=30>
Link Four:
<input Type=text Name=l4 maxlength=50>
</p>
<p> Text Five:
<input Type=text name=t5 maxlength=30>
Link Five:
<input Type=text name=l5 maxlength=50>
</p>
<p>
<input type=submit Name=submit value= Submit >
<input type=submit name=submit2 value= rewrite >
</p>
</form>
</div> "; exit;}
if ($action = = "Edit") {
$wname = "Data.txt"; #数据保存文件, Property 666
$writeurl = "<a href= $l 1> $t 1<\/a><br><br><a href= $l 2> $t 2<\/a><br><br ><a href= $l 3> $t 3<\/a><br><br><a href= $l 4> $t 4<\/a><br><br>< A href= $l 5> $t 5<\/a><br><br> ";
$FP =fopen ($wname, "w");
$ww =fputs ($fp, $writeurl);
if ($WW) {echo file write succeeded;} Else{echo write failed;}
Exit;}
$wname = "Php-bin/data.txt"; #由于是在页面调用, here you must fill in the page and program relative path or absolute path!
$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> ";
?>

To use the first to create a blank file named Data.txt placed in the same level of show.php directory, and then use the include call in the page!
SHOW.PHP?ACTION=CP and can be set, of course, because there is no password protection, you can change the CP to other text!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.