Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我无法从该链接获取到其他链接的id_Php_Html - Fatal编程技术网

Php 我无法从该链接获取到其他链接的id

Php 我无法从该链接获取到其他链接的id,php,html,Php,Html,我有这组代码,我想获取我选择要更新的行的news\u id,但我的其他页面无法获取我要更新的行的news\u id。我真的无法正确理解如何将该id发送到另一个页面。您可以从上次td中编写的url获取id <!DOCTYPE html> <html lang="en"> <?php session_start(); include ("mysql_connect.php"); ?> <head> <meta chars

我有这组代码,我想获取我选择要更新的行的news\u id,但我的其他页面无法获取我要更新的行的news\u id。我真的无法正确理解如何将该id发送到另一个页面。

您可以从上次td中编写的url获取id

<!DOCTYPE html>
<html lang="en">
<?php
    session_start();
    include ("mysql_connect.php");
?>
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>MSWD ADMIN</title>

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

      <link href="css/new.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="css/sb-admin.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
         <div class="header">
         <div class="logo"><img  src="images/logo.png" height="80" width="80"><font color="white" size="6">&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp <u>&nbsp &nbsp &nbspMAKATI Social Welfare Department&nbsp &nbsp &nbsp</u></font></div>
         <img  src="images/header2.jpg" height="150" width="100%">
         </div>
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                 <a class="navbar-brand" href="adminpage.php">MAKATI Social Welfare Department</a>
            </div>
            <!-- Top Menu Items -->
            <ul class="nav navbar-right top-nav">
                <li class="dropdown">

                <li class="dropdown">

                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li>
                              <a href="../admin.php"><i class="fa fa-fw fa-power-off"></i> Log Out</a>

                        <?
                            session_start();
                            session_unset();
                            session_destroy();
                            ob_start();
                            header("location:admin.php");
                            ob_end_flush();
                            exit();
                            ?>

                        </li>
                    </ul>
                </li>
            </ul>
            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav side-nav">
                    <li>
                    <br>
                        <div class="welcomelogo"><img  src="images/welcomelogo.png" height="50" width="50"></div>
                        <div class="welcome"><h3>Welcome,<br> ADMIN</h3></div>
                        <br>
                    </li>

                    <li>
                        <a href="adminpage.php"><i class="fa fa-fw fa-bar-chart-o"></i>Report Generation</a>
                        <br>
                    </li>
                    <li>
                        <a href="mpms.php"><i class="fa fa-fw fa-user-md"></i> Missing Person Management</a>
                        <br>
                    </li>
                     <li>
                        <a href="fams.php"><i class="fa fa-fw fa-user"></i> Form Application Management</a>
                        <br>
                    </li>
                    <li>
                    <li class="active">
                        <a href="cms.php"><i class="fa fa-fw fa-group"></i>Content Management</a>
                    </li>
                    <li>
                        <a href="createaccount.php"><i class="fa fa-fw fa-group"></i>Create Account</a>
                        <br>
                    </li>


                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </nav>

        <div id="page-wrapper">

            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                <br>
                <br>
                <br>
                    <div class="col-lg-12">
                        <h1 class="page-header">
                            Appointment Details
                        </h1>

                        <section class="webdesigntuts-workshop">
                                <form action="" method="">          
                                 <input type="search" placeholder="">               
                                  <button>Search</button>
                                 </form>
                            </section>
                            <li>
                              <a href="cms_add.php"><div class="addmember"><h5><b>Add Appointment</b></h5></div></a>
                            </li>
                            <br>
                           <br>
                           <br>
                    </div>
                </div>
                <!-- /.row -->
                <div class="jumbotron">
                    <div class="column">
                                <tr>    
                                    <td>
                                        <table id="appointment" border="1">
                                        <col width="8%"></col>
                                        <col width="10%"></col>
                                        <col width="15%"></col>
                                        <col width="20%"></col>
                                        <col width="15%"></col>
                                        <col width="10%"></col>
                                    <thead>
                                        <tr>
                                        <center>
                                            <th><center>ID</th>
                                            <th><center>Title</th>
                                            <th><center>Image</th>
                                            <th><center>Content</th>
                                            <th><center>Date</th>
                                            <th><center>Department</th> 
                                            <th><center>Action</center></th>  
                                        </center>

                                        </tr>
                                    </thead>

                <?php 
                $query="SELECT * from tbl_news";
                $result=mysql_query($query);


                while($row=mysql_fetch_array($result)){
            ?>
                <tr>    
                    <td><center><?php echo $row['news_id'];?></center></td>
                    <td><center><?php echo $row['news_title'];?></center></td>
                    <td><center><?php echo "<img src='uploads/news/".$row["news_image"]."'height='120' width=100% >";?></center></td>
                    <td><center><?php echo $row['news_content'];?></center></td>
                    <td><center><?php echo $row['news_date'];?></center></td>
                    <td><center><?php echo $row['news_department'];?></center></td>
                    <td>
                        <?php 

                        $id=$row['news_id'];
                        $_SESSION['id']=$id;

                        echo "<center>
                                <a href='cms_update.php?id=".$id." data-toggle='tooltip' title='Confirm'>
                                <i class='fa fa-check-square'></i>
                                </a>

                                <a href='appointmentDelete.php?id=".$id." data-toggle='tooltip' title='Cancel'>
                                    <i class='fa fa-minus-square'></i>
                                </a>
                            </center>";
                        ?>
                    </td>

                </tr>
            <?php
                }
            ?>
                        </div>
                <!-- /.row -->

            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>


</body>

</html>
从这段代码中,您可以获得像$id=$\u get['id']这样的id

您可以从$\u获取:

希望能有帮助

可能重复的
<a href='cms_update.php?id=".$id." data-toggle='tooltip' title='Confirm'>
   <i class='fa fa-check-square'></i>
</a>
<?php
if (isset($_GET['id']) {
    $id = $_GET['id'];
}