導航:首頁 > 編程語言 > 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彈出輸入框相關的資料

熱點內容
什麼是適合自己的app 瀏覽:451
雲伺服器怎麼補漏洞 瀏覽:176
如何看自己的安卓是什麼等級 瀏覽:633
被丁磊挖走的程序員 瀏覽:19
gsk980ta編程 瀏覽:507
單片機離線 瀏覽:84
解壓助眠敲擊外國長指甲 瀏覽:421
3次元編程 瀏覽:803
夫妻傳送英文命令 瀏覽:316
程序員題代做 瀏覽:950
戴爾伺服器怎麼擴大內存 瀏覽:641
解壓包密碼消失 瀏覽:135
昆侖通態觸摸屏用戶窗加密 瀏覽:564
農信app怎麼看日額 瀏覽:865
iphone備忘錄包含視頻無法加密 瀏覽:283
抖音快手紅包源碼 瀏覽:137
程序員資源分析 瀏覽:586
linux交換分區大小 瀏覽:922
mt怎麼編譯 瀏覽:337
qq郵箱打開pdf 瀏覽:461