⑴ 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。