
你用POST方式傳值,必須要有個(gè)表單,表單提交數(shù)據(jù)后,要echo出變量才能看到,

為都江堰等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及都江堰網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì)、外貿(mào)營(yíng)銷網(wǎng)站建設(shè)、都江堰網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!
你把$xuehao=$_POST["id"];下面加個(gè)echo $xuehao;就可以看到輸出了,在php結(jié)束標(biāo)記?>后面加上一段代碼
html
head
meta charset="utf-8"
/head
body
form action="index.php" method="post"
table
trtd學(xué)號(hào)/td tdinput type="text" name="id"/td/tr
trtd姓名/tdtdinput type="text" name="name"/td/tr
trtd性別/tdtdinput type="text" name="sex"/td/tr
tr td/tdtdinput type="submit" value="提交"/td/tr
/table
/form
/body
/html
我的思路是:
數(shù)據(jù)庫(kù)中新建一個(gè)表
is_showUpdate
字段:id、is_update
記錄 :id=1;is_update = false;
當(dāng)你的程序要修改顯示信息的時(shí)候(也就是展示數(shù)據(jù)),信息修改完畢將is_showUpdate表的記錄標(biāo)記為true
update is_showUpdate set is_update ='true' where id = 1;
展示頁(yè)面通過(guò)js定時(shí)器通過(guò)ajax每五秒調(diào)取下你的接口,接口只是查詢is_showUpdate 表的id為1的記錄 is_update 是否為true;如果該字段為true,則此接口將id=1的記錄的is_update修改為false,然后給前臺(tái)頁(yè)面反水?dāng)?shù)據(jù),刷新頁(yè)面;
可以用無(wú)縫圖片滾動(dòng)效果 如:
!DOCTYPE html
html
head
meta charset="utf-8"
title/title
style
* { margin: 0; padding: 0;}
body{ background-color:#1B1B1B}
#div1{ width: 800px; height: 150px; position: relative; margin: 100px auto;overflow: hidden;}
#div1 ul { width: 800px; height: 150px; position: relative; }
#div1 ul li { height: 150px; float: left; list-style: none; padding-right:20px;}
#div1 ul li img { width: 200px; height: 150px; display: inline-block;}
a{ color: #B4B4B4; }
/style
script type="text/javascript"
window.onload=function(){
var odiv = document.getElementById('div1');
var oul = odiv.getElementsByTagName('ul')[0];
var ali = oul.getElementsByTagName('li');
var spa = -2;
oul.innerHTML=oul.innerHTML+oul.innerHTML;
oul.style.width=ali[0].offsetWidth*ali.length+'px';
function move(){
if(oul.offsetLeft-oul.offsetWidth/2){
oul.style.left='0';
}
if(oul.offsetLeft0){
oul.style.left=-oul.offsetWidth/2+'px'
}
oul.style.left=oul.offsetLeft+spa+'px';
}
var timer = setInterval(move,30)
odiv.onmousemove=function(){clearInterval(timer);}
odiv.onmouseout=function(){timer = setInterval(move,30)};
document.getElementsByTagName('a')[0].onclick = function(){
spa=-2;
}
document.getElementsByTagName('a')[1].onclick = function(){
spa=2;
}
}
/script
/head
body
a href="#" style=" display: block; margin:0 auto; width: 50px;"向左走/a
a href="#" style=" display: block; margin:0 auto; width: 50px;"向右走/a
div id="div1"
ul
liimg src="img/1.jpg"http://li
liimg src="img/2.jpg"http://li
liimg src="img/3.jpg"http://li
liimg src="img/4.jpg"http://li
/ul
/div
/body
/html
上下滾動(dòng)的效果屬于瀏覽器端的效果了。PHP是實(shí)現(xiàn)不了的。需要用javascript來(lái)實(shí)現(xiàn)。如果你想要學(xué)的話,可以找個(gè)jquery的教程。jquery屬于javascript的一個(gè)框架(就好像Thinkphp對(duì)于PHP一樣)。jquery還是比較簡(jiǎn)單容易上手的。很多動(dòng)畫(huà)效果都有現(xiàn)成的函數(shù)。直接填入?yún)?shù)就可以了
哈哈,你這個(gè)需求大部分都是javascript來(lái)完成的.
關(guān)于圖一的列表樣式,無(wú)非就是瀑布流滾動(dòng)配合ajax到php后臺(tái)取數(shù)據(jù)實(shí)現(xiàn)無(wú)限加載而已
插件都是現(xiàn)成的
至于圖二就更簡(jiǎn)單.無(wú)非是一個(gè)javascript的相冊(cè)插件,也用現(xiàn)成的,php就是按照插件的格式把數(shù)據(jù)循環(huán)出來(lái)即可
鑒于你可能比較菜,給你推薦這款插件吧 比較簡(jiǎn)單 配置也有詳細(xì)說(shuō)明