導航:首頁 > 編程語言 > php彈出窗口代碼

php彈出窗口代碼

發布時間:2022-09-06 21:58:43

⑴ 如何用php做出彈出式登陸窗口

如果驗證用PHP在後端,那麼就用Ajax;
<form name="myform" action="" method="post">
<p>用戶:<input type="text" id="username" name="username" maxsize="20" onChange="nameInfor(this.value)"/> <span id="tip1"></span></p>
<p>密碼:<input type="password" name="password" maxsize="50" /> <span id="tip2"></span></p>
<input type="button" name="rgt" value="提交" onclick="dosubmit('subInfor')" />
<input type="button" name="back" value="返回" onclick="dosubmit('back')"/>
</form>

⑵ PHP彈出全新窗口

網頁代碼能控制的只有在a標簽上加上target="_blank", 如<a href="http://www..com" target="_blank">網路</a>, 就能在新窗口打開,如果瀏覽器有其他的設置可以改變打開方式,網頁代碼里就不能保證新窗口打開了。
希望能幫到你

⑶ php中信息發布成功跳出JS提示框代碼

PHP 彈出JS 提示框示例代碼:

<?php
header("Content-type:text/html;charset=utf-8;");
$conn=mysql_connect("localhost","root","root");
if(!$conn){
die("資料庫連接出錯。".mysql_error());
}
mysql_select_db("test");
$sql="insertintotable(id,name)values(1,'chinawinxp')";
$int=mysql_query($sql);
//信息添加或者發布成功
if($int){
$msg="信息發布成功!";
echo("<scripttype='text/javascript'>");
echo("alert('{$msg}');");
//url跳轉
echo("location.href='test.php';");
echo("</script>");
}
?>

運行效果:

⑷ PHP 提交表單後 彈出對話窗口

session_start();
if($_POST[button3]==true)//點擊了登陸按鈕,登陸按鈕的名字叫button3
{
if($_POST[tex]==""||$_POST[tex1]=="")//判斷用戶名密碼是否為空
{
echo "<script>alert('用戶名或密碼不能為空!');history.back();</script>";
}
else {

include("conn/conn.php");//鏈接資料庫鏈接文件
$sql=mysql_query("select username from tb_reguser where username='".$this->username."'and userpwd='".$this->userpwd."'",$conn);//檢查用戶名密碼是否正確
$info=mysql_fetch_array($sql);//查詢結果放入$info中
if($info==false)//如果查詢的結果是錯誤的
{
echo "<script>alert('用戶名或密碼錯誤!');history.back();</script>";
exit;
}
else//如果查到結果,也就是用戶名密碼正確
{
if($_SESSION["unc"]!="")//判斷保存用戶名的session是否為空
{
session_unregister("unc");//不為空的時候讓他為空,這部判斷是為了判斷是否有其他用戶已經登陸,如果有那麼讓他退出,session存放當前用戶
}
session_register("unc");
$_SESSION["unc"]=$this->username;//session放入當前用戶名
//echo "用戶:".$_SESSION["unc"]."登陸成功!"."<br>";
echo "<script>alert('用戶登陸成功!');history.back();</script>";//輸入提示信息,當前用戶登陸成功
echo "點擊<a href='index.php'>這里</a>繼續!";//鏈接到主頁
}
}
}

⑸ php如何製作彈出窗口(像點擊登陸會在當前頁面多處於一個登陸窗口)

php作為伺服器語言是無法單獨完成這個任務的,普遍採用的辦法是配合JS,更加強大的辦法是配合jquery做ajax,最簡單的辦法是使用if($is_login){}else{},然後最中間的部分進行CSS處理,達到彈出窗口(後文遮蓋,前div層顯示)的效果。
希望對你有幫助,歡迎追問。

⑹ 求php彈出登錄對話框的代碼

Asp的彈窗登錄代碼應該可以放到php代碼里吧,你可以試試,你可以到到網路搜索asp彈登錄窗代碼就ok了。

⑺ 求php或html點擊鏈接彈出小窗口的代碼!

functionpopup(msg,timer){
var
h=$(document).scrollTop()+$(window).height();
w=$(window).width();
lw=Math.floor(w/2-200/2);
varht=
'<divid="popup"style="display:none;position:absolute;top:100%;left:'+
lw+
'px;text-align:center;background:#f6f9cc;border:1pxsolid#999;width:200px;z-index:1200;box-shadow:005pxrgba(0,0,0,.4)">'+
'<divclass="popup-content"style="padding:15px"></div>'+
'<ahref="javascript:;"class="close-popup"style="display:inline-block;line-height:20px;position:absolute;right:5px;top:5px;width:20px;text-decoration:none;height:20px;font-family:Arial;font-size:28px;font-weight:bold;text-align:center;color:#777;border-radius:50px;">&times;</a>'+
'</div>';
$('#popup').remove();
$('body').append(ht);
vart;
functionpopout(){
$('#popup').animate({
top:'100%'
},500,function(){
$('#popup').hide();
});
}

$('#popup.close-popup').click(function(){
clearTimeout(t);
popout();

}).hover(function(){
$(this).css({
color:'#000'
})
},function(){
$(this).css({
color:'#777'
})
});
$('#popup.popup-content').html(msg);
$('#popup').show().animate({
top:h/2
},500,function(){
t=setTimeout(function(){
popout();
},timer?parseInt(timer):5500)
});

}

把這段代碼寫在jquery後面,然後直接調用:

popup('內容',3000);//彈出「內容」,3000毫秒後自動關閉

⑻ 在PHP頁面中怎樣添加彈出廣告代碼是什麼

PHP網頁打開自動彈出廣告,五秒後自動關閉的網頁代碼如下:
新建網頁寫入代碼即可
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>網頁彈出廣告窗口 boaer.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body,html{margin:0;padding:0;font-size:12px;font-family:Arial;font:12px/1 Helvetica, Tahoma, Arial, \5b8b\4f53, sans-serif;}
.fixedMask{position:fixed; display:none;top:0; left:0; z-index:999; width:100%; height:100%; background:#000; filter:alpha(opacity=30); opacity:0.3; }
* html { background:url(*) fixed; }
* html body { margin:0; height:100%; }
* html .fixedMask{ position: absolute; left: expression(documentElement.scrollLeft + documentElement.clientWidth - this.offsetWidth); top: expression(documentElement.scrollTop + documentElement.clientHeight - this.offsetHeight); }
#ad{width:570px;height:345px;border:1px solid #333;border-top-width:5px;position:absolute;z-index:9999;left:50%;margin-left:-290px;top:50%;margin-top:-175px;display:none;}
#ad a{display:block;position:absolute;text-decoration:none;right:0;top:0px;font: 12px/1.5 arial;background:#B50000;padding:2px 5px;color:#fff;}
#ad a:hover{background:red;}
</style>
</head>
<body>
<iframe scrolling="no" src="http://boaer.com" style="width:100%;height:1000px"></iframe>
<div id="ad">
<a href="#1" >關閉</a>
<img src="http://home.blueidea.com/attachment/201006/4/194782_1275642410qVBm_m.jpg" alt="" />
</div>
</body>
<script type="text/javascript">
//<![CDATA[
alert('5秒後自動關掉!');
function Mask() {
if (Mask.instance) return Mask.instance;
this.el = document.body.appendChild(document.createElement('DIV'));
this.el.className = 'fixedMask';
Mask.instance = this;
};
Mask.prototype = {
show: function(fn) {
this.el.style.display = 'block';
fn&&fn();
},
hide: function(fn) {
this.el.style.display = 'none';
fn&&fn()
}
};
var x=new Mask();
var AD=document.getElementById('ad');
AD.getElementsByTagName('A')[0].onclick=hide;
x.show(function (){
AD.style.display='block';
});
setTimeout(hide,5000);
function hide(){
x.hide(function (){
AD.style.display='none';
})
}
//]]>
</script>
</html>

閱讀全文

與php彈出窗口代碼相關的資料

熱點內容
死循環會在編譯的時候出錯嗎 瀏覽:984
c51單片機特殊寄存器的原理 瀏覽:576
閃耀永恆特利加密鑰 瀏覽:758
如何誇程序員 瀏覽:776
天津期貨python招聘 瀏覽:263
單片機機器語言寫的程序 瀏覽:548
韓國直播軟體app叫什麼名 瀏覽:916
軍營訓練不聽教官的命令 瀏覽:259
v開頭的音樂播放器是什麼APP 瀏覽:117
單片機是怎麼做出來的 瀏覽:315
博圖怎麼作為opc伺服器 瀏覽:100
編譯做題軟體 瀏覽:293
橋梁檢測pdf 瀏覽:685
化解壓力的一種方法 瀏覽:680
路由器和DSN伺服器有什麼區別 瀏覽:549
android伸縮控制項 瀏覽:853
androidm3u8緩存 瀏覽:236
imphp開源知乎 瀏覽:708
清除網路通配符dos命令 瀏覽:839
鴻蒙系統怎麼快速換回安卓 瀏覽:714