導航:首頁 > 編程語言 > php彈出輸入框

php彈出輸入框

發布時間:2024-10-25 20:06:46

① PYTHON 網站是否可以實現每次進入一個網站的時候直接在輸入框內顯示上一次輸入的內容

當然可以,以下是一個登錄頁面的例子,在第一次點擊登錄後,第二次再打開網頁就會自動填寫第一次的內容:
<html>
<head><title>登錄網頁</title></head>
<body>
<form action="login.php" method="get" onsubmit="savePassword()">
用戶名<input type="text" id="user" value="" />
密碼<input type="password" id="pwd" value="" />
<input type="submit" value="登錄" />
</form>
</body>
</html>
<script language="javascript">
function setCookie(name,value,expires,path,domain,secure)
{
var expSecs = expires*1000;
var expDate = new Date();
expDate.setTime(expDate.getTime()+expSecs);
var expString = ((expires=="-1") ? "" : (";expires="+expDate.toGMTString()))
var pathString = ((path==null) ? "" : (";path="+path))
var domainString = ((domain==null) ? "" : (";domain="+domain))
var secureString = ((secure==true) ? ";secure" : "" )
document.cookie = name + "=" + encodeURI(value) + expString + pathString + domainString + secureString;//encodeURI escape
}

function getCookie(name)
{
var result = null;
var myCookie = document.cookie + ";";
var searchName = name + "=";
var startOfCookie = myCookie.indexOf(searchName);
var endOfCookie;
if (startOfCookie != -1)
{
startOfCookie += searchName.length;
endOfCookie = myCookie.indexOf(";",startOfCookie);//分隔符;
if (endOfCookie==-1)
{
endOfCookie = mycookie.indexOf("&",startOfCookie);//分隔符&
}
result = decodeURI(myCookie.substring(startOfCookie, endOfCookie));//unescape decodeURI
}
if (result==null) result="";
return result;
}

window.onload=function(){
var user=getCookie("user");
if(user){document.getElementById("user").value=user;}
var pwd=getCookie("pwd");
if(pwd){document.getElementById("pwd").value=pwd;}
}

function savePassword()
{
var user=document.getElementById("user").value;
var pwd= document.getElementById("pwd").value;

setCookie("user", user, 24*60*60*7);//一周後失效
setCookie("pwd", pwd, 24*60*60*7);

return true;
}
</script>
</html>

② 配置完PHP環境後在地址欄輸入http://localhost/phpMyAdmin/index.php彈出的是文件下載打開保存對話框

配置沒有支持PHP,所以你得查看PHP是否可以正常運行了~~~
你先運行http://localhost/,如果這樣可以顯示出PHP的歡迎頁面,那PHP就支持了,這個時候如果還是出現上面那種情況,那就說明你的那個phpMyAdmin沒有安裝好了。

閱讀全文

與php彈出輸入框相關的資料

熱點內容
外六角螺絲套頭演算法 瀏覽:838
程序員特殊招數是什麼意思 瀏覽:351
描述加密過程 瀏覽:844
我的世界如何開mod伺服器 瀏覽:904
人體寫生pdf 瀏覽:317
android簡訊驗證碼倒計時 瀏覽:641
排課走班源碼 瀏覽:222
程序員剛畢業去了小公司有發展嗎 瀏覽:90
速騰怎麼安裝安卓手機互聯 瀏覽:143
linux設備驅動程序代碼 瀏覽:301
伺服器的功耗怎麼看 瀏覽:651
app組件哪裡找 瀏覽:87
androidqq紅包 瀏覽:412
伺服器如何傳輸 瀏覽:456
如何快速將多個文件夾快速解壓縮 瀏覽:114
程序員睡前都在想什麼 瀏覽:37
少兒編程技能培訓心得 瀏覽:458
白命令 瀏覽:816
headfirstjavapdf 瀏覽:552
廣數980t怎麼編程 瀏覽:592