PHP reads Excel and queries the specified data

Source: Internet
Author: User
The code is as follows Copy Code

<title>php Tutorial reads Excel and queries the specified data </title>
<body><center> Performance Inquiry System <table border=0><tr>
&LT;TD bgcolor=red align=center) Performance Query system input interface </td>
&LT;TD bgcolor=tintyellow align=left rowspan=2> Description:<br>
Please enter the correct and complete data .<br>
This inquiry system is for reference only, the actual report card is quasi .<br>
For example: Query the first semester of the 2001 school year two, one Grade one class <br>
Learn number Input format Example:c017037<br>
<br></td><tr>
&LT;TD bgcolor=tintblue align=center><center><form action=nscore.php method=get>
<select name=pl>
<option value=2001>2001
<option value=2002>2002
<option value=2003>2003
<option value=2004>2004
</select) school year
<select name=p2>
<option value=1> A
<option value=2> II
</select> Semester <br>
<select name=p3>
<option value=1> Two Special
<option value=2> Two technology
<option value=3> Four Technology
</select> Educational System
<select name=p4>
<option value=1> Electronic
<option value=2> Motor
<option value=3> Machinery
<option Value=4> Civil
<option value=5> administered
<option value=6> Ring Work
<option Value=7> Capital Management
<option value=8> should be outside
</select> Department/Branch
<select name=p5>
<option value=1> A
<option value=2> II
<option value=3> Three
</select> Grade
<select name=p6>
<option value=1> A
<option value=2> II
<option value=3> Three
<option value=4> Four
</select> class <br>
<b> No.: </b><input size=10 name=no><br><br>
<input type=submit value= determine name=submit>
</form>
</center></td>
</tr>
</table>
</body>

PHP code

<?php
$filename = $pl. $p 2 $p 3.trim ($p 4). Trim ($p 5). Trim ($p 6). ". dbf";
if (file_exists ($filename)) (
$f =dbase_open ($fiiename, 0);
$k =dbase_get_record ($f, 1);
for ($i =2; $i <dbase_numrecords ($f); $i + +) {
$a =dbase_get_record ($f, $i);
if ($no ==trim ($a [0])) {
echo "echo "echo "$a [0] $a [1]<br>";;
echo "<table border=1>";
echo "<tr><td><center> subject name </td><td) <center> fractions </td>";
For ($j =2 $j < (Dbase_numfields ($f); $j + +) {
echo "<tr><td><center> $k [$j]</td><center> $a [$j]</td>];
}//end for J
Break
}//end if
}//end for I
echo "</tr>";
Dbase_close ($f);
} else {
echo "error message: Score Database tutorial Not yet established <br>";
}
if ($no = = "") {Echo error message: Please enter school number <br> ";}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.