很多站长朋友们都不太清楚php网站界面代码,今天小编就来给大家整理php网站界面代码,希望对各位有所帮助,具体内容如下:
本文目录一览: 1、 php网页怎么编辑源代码? 2、 在PHP页面中怎样添加弹出广告代码是什么?? 3、 php登录界面的代码问题 4、 php或html网页跳转代码 5、 求一个PHP登陆页面代码 6、 PHP做一个用户登录页面 php网页怎么编辑源代码?现在这个页面没有具体代码 只有两句话
第一句 定义个常数 值=1
第二具 引用一个文件 叫做 load.php
你需要去修改 load.php 页面的代码 所有输出应该到在那个页面中。
在PHP页面中怎样添加弹出广告代码是什么??PHP网页打开自动弹出广告,五秒后自动关闭的网页代码如下:
新建网页写入代码即可
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<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="" style="width:100%;height:1000px"></iframe>
<div id="ad">
<a href="#1" >关闭</a>
<img src="" 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';
fnfn();
},
hide: function(fn) {
this.el.style.display = 'none';
fnfn()
}
};
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登录界面的代码问题$rss==mysql_fetch_object($result)
不等于自然进入else
应该是一个等于号
php或html网页跳转代码header()函数:
header()函数是PHP中进行页面跳转的一种十分简单的方法。header()函数的主要功能是将HTTP协议标头(header)输出到浏览器。
header()函数的定义如下:
void header (string string [,bool replace [,int http_response_code]])
可选参数replace指明是替换前一条类似标头还是添加一条相同类型的标头,默认为替换。
第二个可选参数http_response_code强制将HTTP相应代码设为指定值。 header函数中Location类型的标头是一种特殊的header调用,常用来实现页面跳转。注意:1.location和“:”号间不能有空格,否则不会跳转。
2.在用header前不能有任何的输出。
3.header后的PHP代码还会被执行。例如,将浏览器重定向到lamp兄弟连官方论坛
< ?php
//重定向浏览器
header("Location: .
lampbrother.net");
//确保重定向后,后续代码不会被执行
exit;
?>
PHP页面跳转二、Meta标签
Meta标签是HTML中负责提供文档元信息的标签,在PHP程序中使用该标签,也可以实现页面跳转。 若定义http-equiv为refresh,则打开该页面时将根据content规定的值在一定时间内跳转到相应页面。
若设置content="秒数;url=网址",则定义了经过多长时间后页面跳转到指定的网址。例如,使用meta标签实现疫苗后页面自动跳转到LAMP兄弟连官方论坛。
< meta http-equiv="refresh" content="1;url=">
例如,以下程序meta.php实现在该页面中停留一秒后页面自动跳转到bbs.lampbrother.net。
< ?php $url = ""; ?> < html> < head> < meta http-equiv="refresh" content="1; url=< ?php echo $url; ?>"> < /head> < body>
PHP页面跳转三、JavaScript
例如,此代码可以放在程序中的任何合法位置。
< ?php $url = ""; echo "< script language='javascript' type='text/javascript'>"; echo "window.location.href='$url'"; echo "< /script>"; ?>
求一个PHP登陆页面代码改完了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>这里是网站的标题</title>
<link href="css/index.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
font-size: 14px;
}
a:link {
text-decoration: none;
color: #FFFFFF;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.STYLE99 {
font-family: Georgia, "Times New Roman", Times, serif;
color: #FF00FF;
}
-->
</style></head>
<body>
<div id="bigbox" class="ceng">
<div id="banner" class="ceng"><img src="/data/upload/help/202303/02/329bf8cc3859ef15d08900327fb051cf.gif" width="778" height="70" /></div>
<div id="main" class="ceng">
<form id="form1" name="form1" method="post" action="post.php">
<div id="log">
<div id="logxx"><span class="dazi">这里是网站的标题</span></div>
<div id="yonghu">用户名:
<input name="user" type="text" id="user" />
</div>
<div id="mima">密 码:
<input name="pass" type="password" id="pass" />
</div>
<div id="yanzheng">验证码:
<input name="yz" type="text" id="yz" size="8" maxlength="4" />
<?php
//$yzm = rand(1000, 9999 );
//echo $yzm;
$seedarray =microtime();
$seedstr =split(" ",$seedarray,5);
$seed =$seedstr[0]*10000;
//第二步:使用种子初始化随机数发生器
srand($seed);
//第三步:生成指定范围内的随机数
$random =rand(1000,9999);
echo "<span class=\"STYLE99\">".$random."</span>";
?>
<input name="hiddenField" type="hidden" id="hiddenField" value="<?php echo $random ?>" />
</div>
<div id="tijiao">
<input type="submit" name="Submit" value="提交" />
<input type="reset" name="Submit2" value="重置" />
</div>
</div>
</form>
</div>
<?php include("buttom.php");?>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>这里是网站的标题 </title>
<link href="css/index.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
font-size: 14px;
}
a:link {
text-decoration: none;
color: #FFFFFF;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
-->
</style></head>
<body>
<div id="bigbox" class="ceng">
<div id="banner" class="ceng"><img src="/data/upload/help/202303/02/329bf8cc3859ef15d08900327fb051cf.gif" width="778" height="70" /></div>
<div id="main" class="ceng">
<div id="log">
<div id="logxx"><span class="dazi">这里是网站的标题</span></div>
<div id="yonghu">
<?php
function make_safe($variable) {
$variable = addslashes(trim($variable));
return $variable;
}
$user=make_safe($_REQUEST["user"]);
$pass=make_safe($_REQUEST["pass"]);
$yz=make_safe($_REQUEST["yz"]);
$yzma=make_safe($_REQUEST["hiddenField"]);
if ($yz == $yzma)
{
if ($user=="" or $pass=="" or $yz =="")
{
echo"你输入的信息有空,请<a href=\"login.php\">"."返回"."</a>重新输入";
}
else
{
mysql_connect("localhost","root","12345") /*请修改用户名和密码*/
or die("无法连接数据库,请重来");
mysql_select_db("user")
or die("无法选择数据库,请重来");
mysql_query("SET NAMES 'gbk'");/*解决汉字*/
$row = mysql_fetch_assoc(mysql_query(" SELECT pass,xh FROM yh where name = '$user' and password = '$pass'"));
$mima=$row[password];
if($pass == $mima)
{
session_start();
$_SESSION['yhm']=$user;
echo "<script>alert('成功登陆')</script>";
echo "<script>window.location.href='a.php';</script>";
}
else
{
echo"你的用户名或者密码输入错误,请<a href=\"login.php\">"."返回"."</a>";
}
}
}
else
{
echo"您输入的验证码不正确!请<a href=\"login.php\">"."返回"."</a>";
}
?>
</div>
<div id="mima"></div>
<div id="yanzheng"></div>
<div id="tijiao"></div>
</div>
</div>
<?php include("buttom.php");?>
</div>
</body>
</html>
PHP做一个用户登录页面index.html登录页面代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>登录示例</title>
</head>
<body>
<form id="forms" name="forms" method="post" action="loginchk.php">
用户名:<input type="text" id="uname" name="uname" value=""/><br/>
密码:<input type="password" id="upass" name="upass" value=""/><br/>
<input type="submit" id="loginbtn" value="立即登录"/>
<input type="reset" id="resetbtn" value="重新填写"/>
</form>
</body>
</html>
loginchk.php 的PHP程序代码如下:
<?php
$uname=trim($_REQUEST["uname"]);
$upass=trim($_REQUEST["upass"]);
if($uname=="admin"$upass=="admin")
{
echo "登录成功";
}
else
{
echo "登录失败,<a href='index.html'>重新登录</a>";
}
?>
以上只是一个简单示例,真正的开始,需要考到很多因素,比如说登录前有效性检查,加入登录验证码,程序需要连接数据库进行用户匹配等。
希望对你有帮助 。
如果使用数据库进行进行匹配的话,PHP程序可以这样改进一下。
<?php
$uname=trim($_REQUEST["uname"]);
$upass=trim($_REQUEST["upass"]);
$con = mysql_connect("localhost","root","root");
mysql_select_db("dbname", $con);
$result = mysql_query("select * from dusers where uname='$uname' and upass='$upass'");
$rs = mysql_fetch_array($result);
if($rs)
{
echo "登录成功";
}
else
{
echo "登录失败,<a href='index.html'>重新登录</a>";
}
?>
不过你需要连接到你自己的指定的数据库和数据表。
关于php网站界面代码的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。