导航:首页 > 编程语言 > 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弹出窗口代码相关的资料

热点内容
androidm3u8缓存 浏览:234
imphp开源知乎 浏览:706
清除网络通配符dos命令 浏览:837
鸿蒙系统怎么快速换回安卓 浏览:712
pdf绿色虚拟打印机 浏览:213
androidtab框架 浏览:147
java转php的时间戳 浏览:639
编译libstdc依赖 浏览:657
清算法人与原法人的区别 浏览:410
家庭装修下载什么app软件 浏览:575
美食博主用什么app拍视频 浏览:815
ipone手机如何加密微信 浏览:357
自来水加密阀阀帽 浏览:437
华为交换机dhcp配置命令 浏览:319
androidbitmap缩小 浏览:275
单片机串口控制灯 浏览:88
大讯云服务器安装视频 浏览:788
华为算法领先世界 浏览:658
linux路由重启 浏览:570
php的模板编程 浏览:324