Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.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使网页显示所有内容?_Php_Html - Fatal编程技术网

如何使用php使网页显示所有内容?

如何使用php使网页显示所有内容?,php,html,Php,Html,我是新的php编码。我正在处理以前使用.html扩展名保存的网页。为了添加一段php代码,我必须将其扩展名改为.php。现在,当我运行代码时,它不会显示html版本代码中显示的表及其内容。我不明白我需要什么样的改变才能使它完美地工作。我的代码写在下面: myCode.php <body> <!-- banner --> <div class="banner"> <div class="navigation">

我是新的php编码。我正在处理以前使用.html扩展名保存的网页。为了添加一段php代码,我必须将其扩展名改为.php。现在,当我运行代码时,它不会显示html版本代码中显示的表及其内容。我不明白我需要什么样的改变才能使它完美地工作。我的代码写在下面:

myCode.php

  <body>
<!-- banner -->
    <div class="banner">
        <div class="navigation">
            <div class="container-fluid">
                <nav class="pull">
                    <ul class="nav">
                        <li><a href="index.php" class="active"> Home</a></li>
                        <li><a href="#about" class="scroll"> About</a></li>
                        <li><a href="#portfolio" class="menu scroll">Popular Places<span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span></a></li>
                            <ul class="nav-sub">
                                <li><a href="#portfolio" class="scroll">Place 1</a></li>                                             
                                <li><a href="#portfolio" class="scroll">Place 2</a></li>                                                                                                
                                <li><a href="#portfolio" class="scroll">Place 3</a></li> 
                            </ul>
                            <script>
                                $( "li a.menu" ).click(function() {
                                $( "ul.nav-sub" ).slideToggle( 300, function() {
                                // Animation complete.
                                });
                                });
                            </script>
                        <li><a href="#events" class="scroll"> Events</a></li>
                        <li><a href="#mail" class="scroll"> Mail us</a></li>
                    </ul>
                </nav>
            </div>
        </div>
        <div class="header-top">
            <div class="container">
                <div class="head-logo">
                    <a href="index.php"><span>M</span>ytripplanner</a>
                </div>
                <div class="top-nav">
                    <div class="hero fa-navicon fa-2x nav_slide_button" id="hero">
                        <a href="#"><img src="images/menu.png" alt=""></a>
                    </div>  
                </div>  
                <div class="clearfix"> </div>
            </div>
        </div>
        <div class="banner-info">
            <div class="container">
                <h1>Plan Your Trip</h1>
                <div class="sap_tabs">  
                    <div id="horizontalTab" style="display: block; width: 100%; margin: 0px;">
                          <ul class="resp-tabs-list">
                              <li class="resp-tab-item grid1" aria-controls="tab_item-0" role="tab"><span><i class="glyphicon glyphicon-home" aria-hidden="true"></i>Hotels</span></li>
                              <li class="resp-tab-item grid2" aria-controls="tab_item-1" role="tab"><span><i class="glyphicon glyphicon-glass" aria-hidden="true"></i>Restaurants</span></li>
                              <li class="resp-tab-item grid3" aria-controls="tab_item-2" role="tab"><span><i class="glyphicon glyphicon-heart" aria-hidden="true"></i>Things to do</span></li>
                              <li class="resp-tab-item grid5" aria-controls="tab_item-3" role="tab"><span><i class="glyphicon glyphicon-map-marker" aria-hidden="true"></i>Shopping</span></li>
                              <div class="clear"></div>
                          </ul>                  
                            <div class="resp-tabs-container">

                                <div class="tab-1 resp-tab-content" aria-labelledby="tab_item-0">
                                    <div class="facts">
                                        <div class="booking-form">
                                            <div class="online_reservation">
                                                    <div class="b_room">
                                                        <div class="booking_room">
                                                            <div class="reservation">
                                                                <ul>        
                                                                    <li  class="span1_of_1 desti">
                                                                         <div class="book_date">
                                                                             <form method="post">


        <div class="dropdownstay">
            <select  name="city" class="option3" id="dropdown" >
                <option  value="1" id="1" style="font-size:20px; font-family:Monotype Corsiva;" >Lahore</option>
                <option value="2" id="2" style="font-size:20px; font-family:Monotype Corsiva;">Dubai </option>
                <option  value="3" id="3"  style="font-size:20px; font-family:Monotype Corsiva;">Newyork</option>
                <option value="4" id="4"style="font-size:20px; font-family:Monotype Corsiva;">Canberra</option>
                <option  value="5" id="5" style="font-size:20px; font-family:Monotype Corsiva;">Kuala Lampur</option>
                <br>

        </select>
        </form>
        <!--end for drop down -->
</div>
                                                                         <?php 
                                                                         session_start();

                                                               $_SESSION['city_id'] = $_POST['index'];  
                                                               ?> 
                                                                         </div>                 
                                                                     </li>
                                                                </ul>
                                                            </div>
                                                            <div class="reservation">
                                                                <ul>    
                                                                     <li  class="span1_of_1">
                                                                         <h5>What you want in hotel?</h5>
                                                                         <br>
                                                                         <form action="checkbox_value.php" method="post">

        <section title="preferences">
      <input type="checkbox" value="is_pool" id="pool" name="check_list[]" checked /> 
      <text style="font-size:20px; font-family: Times New Roman;"> Pool </text>
      <br/>
      <input type="checkbox" value="is_gym" id="gym" name="check_list[]" checked />
      <text style="font-size:20px; font-family: Times New Roman;"> Gym </text>
      <br/>
      <input type="checkbox" value="is_beach" id="beach" name="check_list[]" />
      <text style="font-size:20px; font-family: Times New Roman;"> Beach </text>
      <br/>
      <input type="checkbox" value="is_spa" id="spa" name="check_list[]" />
      <text style="font-size:20px; font-family: Times New Roman;"> Spa </text>
      <br/>
      <input type="checkbox" value="is_wifi" id="wifi" name="check_list[]" checked /> 
      <text style="font-size:20px; font-family: Times New Roman;"> Wifi </text>
      <br/>
      <input type="checkbox" value="is_familyoriented" id="family" name="check_list[]"/>
      <text style="font-size:20px; font-family: Times New Roman;"> Family </text>
      <br/>
      <input type="checkbox" value="is_economical" id="economical" name="check_list[]" />
      <text style="font-size:20px; font-family: Times New Roman;"> Economical </text>
      <br>
      <br>
      <br>
      <br>
  </section>

                                                                                <input type="submit" name="submit" value="Submit" />
                                                                                <?php include 'checkbox_value.php';?>

                                                                             </form>

                                                                     </li>

                                                                     <div class="clearfix"></div>
                                                                </ul>
                                                                    <!---strat-date-piker---->
                                                                        <link rel="stylesheet" href="css/jquery-ui.css" />
                                                                        <script src="js/jquery-ui.js"></script>
                                                                          <script>

                                                                          </script>
                                                                    <!---/End-date-piker---->
                                                            </div>
                                                            <div class="reservation">
                                                                <ul>    
                                                                     <li class="span1_of_3">
                                                                            <div class="date_btn">

                                                                            </div>
                                                                     </li>
                                                                     <div class="clearfix"></div>
                                                                </ul>
                                                            </div>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                    </div>
                                            </div>
                                            <!---->
                                        </div>  
                                    </div>
                                </div>
<?php
class MyDB extends SQLite3
{
    function __construct()
    {
        $this->open('mytrip.db');

    }
}
$db = new MyDB();
if(!$db){
    echo $db->lastErrorMsg();
} else {

}

$hotelOptions = array('is_pool', 'is_gym', 'is_spa', 'is_wifi', 'is_beach', 'is_familyoriented', 'is_economical');
$countOptions = array(
    'is_pool' => 'pool_count',
    'is_gym' => 'gym_count',
    'is_spa' => 'spa_count',
    'is_wifi' => 'wifi_count',
    'is_beach' => 'beach_count',
    'is_familyoriented' => 'family_count',
    'is_economical' => 'econo_count',
);
//$cities = array(1 => 'Dubai');


if (isset($_POST['submit'])) {
   // $selected_city= $_POST['city'];
    if (!empty($_POST['check_list']) && is_array($_POST['check_list'])) {
        $profpic = "images/Yellow.jpg";
        //echo "<p> Destination: ".$selected_city ."</p>";
        // Counting number of checked checkboxes.
        $checked_count = count($_POST['check_list']);
        echo "You have selected following ".$checked_count." option(s): <br/>";
        // Loop to store and display values of individual checked checkbox.
        $where = '';
        $order = '';
        foreach($_POST['check_list'] as $selected) {
            echo "<p>".$selected ."</p>";
            if (array_search($selected, $hotelOptions) !== false) {
                $where .= " AND {$selected} = 1";
                $order .= " {$countOptions[$selected]} DESC,";
            }
        }
        $where = substr($where, 5, strlen($where));
        $order = substr($order, 0, strlen($order) - 1);
        //echo "<p>".$where ."</p>";
        //echo "<p>".$order ."</p>";
        session_start();
        $id=$_SESSION['Id'];
        $selected_city=$_SESSION['city_id'];
        if (isset($selected_city)) {

          // $sql = "SELECT hotel_name FROM ".$selected_city." WHERE ".$where." ORDER BY ".$order.";";
              $sql = "SELECT hotel_name FROM hotel WHERE ".$where." AND city_id= "$.selected_city." ORDER BY ".$order.";";
           // echo "<p>".$sql ."</p>";
            $ret = $db->query($sql);
            $ar= array();
            $i=0;
            while($row = $ret->fetchArray(SQLITE3_ASSOC) ){
                echo "<p> <br /></p>\n";
                echo "\n". $row['hotel_name'] . "\n";
                $ar[$i]= $row['hotel_name'];
                $i++;
            }


            if (is_array($ar))
             {
                foreach ($ar as $value)
                {
                   echo "<p> Array is " .$value. "<p>";
                   $sql= "INSERT INTO Search (Id, History)
      VALUES ('$id','$value')";
                   $ret = $db->query($sql);
                }
            }


        }
    } else {
        echo "<b>Please Select Atleast One Option.</b>";
    }
    $db->close();
}

?>

<html>
<head>
<style type="text/css">

body {
background-image: url('<?php echo $profpic;?>');
}
</style>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

</head>
<body>
</body>
</html>

    $(“LIA.menu”)。单击(函数(){ $(“ul.nav sub”).滑动切换(300,函数(){ //动画完成。 }); });
计划你的旅行
    酒店 餐厅 要做的事情 购物
  • 拉合尔 迪拜 纽约 堪培拉 吉隆坡
  • 你想在旅馆里干什么?
    水塘
    健身房
    海滩
    水疗生活馆
    无线网络
    家庭
    经济的