Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/290.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_Mysqli - Fatal编程技术网

Php 搜索表单-不显示页面内容

Php 搜索表单-不显示页面内容,php,html,mysqli,Php,Html,Mysqli,我就是这样开始做一个搜索表单的,它应该是这样的,一个人在照顾Fitnessdk和nordsjælland,所以大家都站出来 问题是,现在它是这样的,它不会拿出它,因为我一直在寻找 Php: html格式: 页面上不会出现任何内容。JFYI,一个类似“请阅读我的代码,制定一个问题并回答它”这样的问题,这是一个经过深思熟虑的离题问题。@YourCommonSense你的意思是什么?你的表格正在发送给?改为PHP的script@przeqpiciel我应该在里面写什么?@Jesperbook,你解决问

我就是这样开始做一个搜索表单的,它应该是这样的,一个人在照顾Fitnessdk和nordsjælland,所以大家都站出来

问题是,现在它是这样的,它不会拿出它,因为我一直在寻找

Php:

html格式:


页面上不会出现任何内容。

JFYI,一个类似“请阅读我的代码,制定一个问题并回答它”这样的问题,这是一个经过深思熟虑的离题问题。@YourCommonSense你的意思是什么?你的表格正在发送给?改为PHP的script@przeqpiciel我应该在里面写什么?@Jesperbook,你解决问题了吗?关于mysql语法,您可能会使用以下语法:fitness类\'%.$fitness.'\'和landsdel类\'%.$landsdel.%\'
if(isset($_POST["sognu"]))
{
    if ($stmt = $this->mysqli->prepare('SELECT fms_opslag.id, fms_opslag.title, fms_opslag.undertitle, fms_opslag.fitness, fms_opslag.landsdel, fms_opslag.brugerid, fms_bruger.profilbillede FROM fms_opslag INNER JOIN fms_bruger ON fms_opslag.brugerid=fms_bruger.id WHERE fitness LIKE "%".$fitness."%" AND landsdel LIKE "%".$landsdel."%" ORDER BY fms_opslag.tidspunkt DESC'))
    { 
        $stmt->bind_param('ss', $fitness, $landsdel);
        $fitness = $_post["fitness"];
        $landsdel = $_post["omrade"];
        $stmt->execute();
        $stmt->bind_result($id, $title, $undertitle, $fitness, $landsdel, $brugerid, $profilbillede);
        while ($stmt->fetch()) {
        ?>
        <tr class="postbox">
            <td>
                <a href="/profil/<?php echo $brugerid;?>/"><img src="/profil-img/smaa/<?php echo $profilbillede;?>"></a>
            </td>
            <td class="tabletitle">
                <h3><?php echo $title;?></h3>
                <p><?php echo $undertitle;?></p>
                <?php
                if($_SESSION["login"] == true)
                {
                ?>
                <form action="/ansog/<?php echo $id;?>/" method="post">
                    <input type="submit" name="ansoge" value="Ansøg nu" class="kliknuBB">
                </form>
                <?php
                }
                ?>
            </td>
            <td class="tableomrade">
                <p><?php echo $fitness;?></p>
            </td>
            <td class="tablemap">
                <p><?php echo $landsdel;?></p>
            </td>
        </tr>
        <?php
        }
        $stmt->close();

    }
}
<form action="#" method="post">
<div id="search-top">
    <div class="infobarindhold">
        <p>Fitness center</p>
        <select name="fitness" class="bar">
        <?php
            if ($stmt = $this->mysqli->prepare('SELECT navn FROM fms_fitness')) { 
                $stmt->execute();
                $stmt->bind_result($navn);
                while ($stmt->fetch()) {
                ?>
                <option value="<?php echo $navn;?>"><?php echo $navn;?></option>
                <?php
                }
                $stmt->close();
            }
        ?>
        </select>
    </div>
    <div class="infobarindhold">
        <p>Placering</p>
        <select name="omrade" class="bar">
          <?php
                if ($stmt = $this->mysqli->prepare('SELECT navn FROM fms_landsdel')) { 
                    $stmt->execute();
                    $stmt->bind_result($navn);
                    while ($stmt->fetch()) {
                    ?>
                    <option value="<?php echo $navn;?>"><?php echo $navn;?></option>
                    <?php
                    }
                    $stmt->close();
                }
            ?>
        </select>
    </div>
    <div class="cl"></div>
</div>
<div id="sogbar">
    <input type="submit" name="sognu" value=" " class="sognu">
    <div class="cl"></div>
</div>