1

我有一个程序,它从 PHP 文件中搜索数据库,并链接回带有输出的某个文件。它在所有浏览器中都能完美运行,不包括 IE。我不知道为什么。这是我的代码:

<?php
if( isset( $_POST['schoolname'] ) && strlen( trim( $_POST['schoolname'] ) ) > 0  )
{
        $school = filter_input(INPUT_POST, 'find', FILTER_SANITIZE_STRING);
        $school = $_POST['schoolname'];
        #connecting to the database
        $conn = mysql_connect("localhost", "root");
        mysql_select_db("finalproject");

        $sql = "select * from presentations where school like '%$school%'";

        $result = mysql_query($sql, $conn) or die(mysql_error());
        #this is the array that stores and displays the results of the search
        if ( mysql_num_rows($result) >0)
        {
            while ($newArray = mysql_fetch_array($result))
            {
                $school  = $newArray['school'];
                $date = $newArray['date'];
                $place  = $newArray['place'];
                $time = $newArray['time'];


                echo $school . ", " . $place . ", " . $date . ", " . $time . "<br />" . "<br />";
            }
        }
        else
        {
            echo "Record not found" . "<br />" . "<br />";
        }



        mysql_close($conn);
}

?>
<!-- The form in which the search happens -->
<form action=" " method="post">
School's name: <input type="text" name="schoolname">
<input type="submit" name="button" value="Search">
</form>

这只是我在 IFrame 中的代码。

4

0 回答 0