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 内のコードです。