導航:首頁 > 編程語言 > php自動跳轉網頁

php自動跳轉網頁

發布時間:2022-06-24 10:34:21

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是怎麼回事

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

閱讀全文

與php自動跳轉網頁相關的資料

熱點內容
unix網路命令 瀏覽:48
程序員表白代碼大全可復制 瀏覽:365
手機如何共享web伺服器 瀏覽:956
php介面有什麼用 瀏覽:382
iis如何安裝php 瀏覽:791
k5嗜血魔鍵安卓怎麼調好用 瀏覽:834
建行app中如何添加銀行卡 瀏覽:281
簡便演算法100點 瀏覽:161
如何創新我的世界伺服器 瀏覽:881
戰地怎麼看伺服器地址 瀏覽:348
vue怎麼打包放上伺服器 瀏覽:165
為什麼安卓服夏日活動沒有兔子頭 瀏覽:894
pubg為什麼顯示伺服器連接失敗 瀏覽:650
阿里雲掃碼登錄伺服器 瀏覽:971
化學基礎pdf 瀏覽:896
51單片機晶碼管 瀏覽:281
怎麼查伺服器假死原因日誌在哪看 瀏覽:277
掃描pdf文件 瀏覽:926
解壓密碼百度雲在線解壓 瀏覽:767
傳播學演算法推薦 瀏覽:749