⑴ php中,执行登录后如何自动跳转到指定页面
<?php
ob_start();
include("conn.php");
if (isset($_POST['username']) && isset($_POST['password'])){
$username=$_POST['username'];
$sql="select password from login where username='$username'";
$res=mysql_query($sql);
list($password)=mysql_fetch_row($res);
mysql_free_result($res);
if ($username==$_POST['username'] && $password==$_POST['password']){
echo "登录成功";
//header("location:sy-1.php");
echo "<script>window.location.herf='sy-1.php';</script>";//在这里添加
ob_end_flush();
}else{
echo "登录失败";
}
}
?>
⑵ php或html网页跳转代码
<table style="width:100%; height:100%;">
<tr style="height:100%;">
<td style="text-align:left;width:170px;vertical-align:top;background-color:#9ACD32;">
<ul id="ull" style="">
<li id="a" onclick="danwei(this)">购进食材</li>
<li id="e" onclick="danwei(this)">食材消耗记录</li>
<li id="b" onclick="danwei(this)">维护食材信息</li>
<li id="c" onclick="danwei(this)">维护食材分类信息</li>
<li id="d" onclick="danwei(this)">维护单位信息</li>
</ul>
</td>
<td>
<iframe id="aa" src="shibiao.html" style="width:100%;height:100%;" scrolling="auto" frameborder="0"></iframe>
</td>
</tr>
</table>
<script>
function danwei(fan) {
if (fan.id == "d") {//判断 id为d 时执行下面语句
document.getElementById("aa").src = "danweixinxi.html";//找到id“aa” src=“单位信息.html”
} else if (fan.id == "a") {
document.getElementById("aa").src = "shibiao.html";//找到id“aa” src=“食表=食材表.html”
} else if (fan.id == "c") {
document.getElementById("aa").src = "shicaifeilei.html";
} else if (fan.id == "b") {
document.getElementById("aa").src = "shicai.html";
} else if (fan.id == "e") {
document.getElementById("aa").src = "shicaixiaohaojl.html";
}
}
</script>
⑶ 请问如何在php环境下点击图片跳转网页
跳转跟PHP没有关系的,你想跳转只需要给你的图片加上超链接就可以了。
比如我直接用你的代码:
<ahref=""><!--这个href属性值就是你想要跳转过去的URL-->
<divclass="article-wechats"><imgsrc="images/572804.png"></div>
</a>
//如果是用PHP,就把它当作字符串输出即可:
$html='<ahref=""><divclass="article-wechats"><imgsrc="images/572804.png"></div>
</a>';
echo$html;
⑷ phpstudy打开localhost总是自动跳转到localhost/index.html是怎么回事
是 phpstudy 搭建的服务器站点根目录下,缺少名为 index.html 的文件。服务器都会设置一个默认的访问主页文件,如图
调整前后顺序,将 index.php 放前面。默认打开文档是根据上面的文件名顺序来完成搜索的,先搜索第1个,如果没找到,再搜索后面的。如果 index.php 放前面,先打开的就是 index.php。
⑸ PHP html如何实现进入一个网页后自动跳转到多个网站
建议通过javascript实现,比如 window.open 可以打开新窗口。打开多个的话,只要把url存储到数组,通过数组循环多次执行window.open即可。
⑹ PHP怎么获取网页的网址并自动跳转
$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']这是获取完整url。
用header方法跳转 例header("地址");
⑺ php 在网页登陆成功后怎么实现网页跳转,由login跳转到index
需要准备的材料分别是:电脑、php编辑器、浏览器。
1、首先,打开php编辑器,新建php文件,例如:index.php。