亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在新選項卡中打開用戶配置文件

在新選項卡中打開用戶配置文件

PHP
海綿寶寶撒 2021-06-12 14:05:16
我在表格中顯示聲明,我想讓每一行都可以點擊,這有點像我用 js onclick 函數所做的(我只能點擊名稱,但我想將它應用到整行)?,F在我想在新選項卡中查看有關公告的詳細信息。我的問題從這里開始。我想在單擊一行時獲得公告 ID,但不知道該怎么做。另外,我正在使用 js 進行 onclick,其余部分是 php,因此那里變得有點混亂。我知道這不是最好的方法,所以我需要你關于如何解決這個問題的建議。PS我對js不是很熟悉,那些js部分取自網絡教程。下面的代碼是我顯示搜索結果的部分。<section id="results">    <div class="container">        <table>            <tr>                <a href="#"><th>Name</th></a>                <th>Where</th>                <th>From</th>                <th>Date</th>                <th>Price</th>                <th>Type</th>                <th>PId</th>            </tr>            <?php                if(isset($_POST['search_btn'])){                    include_once "db_connect.php";                    $from = $_POST['from'];                    $where = $_POST['where'];                    $date = $_POST['date'];                    $type = $_POST['type'];                    $procid = $_POST['proc_id'];                if(empty($from) || empty($where) || empty($date) || empty($type)){                    header("Location: index.php?search=empty");                    exit();                }else{                    $sql = "SELECT * FROM proc WHERE p_from = '".$from."' and p_where = '".$where."' and type= '".$type."' ";                    $query = mysqli_query($conn, $sql);                    $num_rows = mysqli_num_rows($query);                        while ($rows = mysqli_fetch_array($query, MYSQLI_ASSOC)) {                            echo "<tr><td onclick='content(this)'>" . $rows['p_name'] . " " . $rows['p_surname']. " </td><td>" .$rows['p_from']. "</td><td>" .$rows['p_where']. "</td><td>" .$rows['p_date']. "</td><td>" .$rows['price']. "</td><td>" .$rows['type']. "</td></tr>" ;                        }                        echo "</table>";                    }                }else{                        echo "Error!";                    }            ?>
查看完整描述

3 回答

?
哆啦的時光機

TA貢獻1779條經驗 獲得超6個贊

試試這個

<a href="your url address" target = "_blank"> link name </a>


查看完整回答
反對 回復 2021-06-19
  • 3 回答
  • 0 關注
  • 122 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號