⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.php

📁 自制国外大学学校计算机学院网站
💻 PHP
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="comp3.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="This page is the homepage for Loughbourgh University Undergraduate courses in Computer Science" />
<meta name="keywords" content="computer, computer science, artificial intelligence, e-business, information, technology, management, foundation, mathematics, maths, home" />
<title>Computer Science Depatment</title>
<style type="text/css">
<!--
.style1 {font-size: xx-small}
-->
</style>

<script type = "text/javascript">

var xhr; //create XMLHttpRequest variable xhr
var url; //the answer variable

function searchDB(search_request) {
	xhr = null;//initialise xhr
	if (search_request.length == 0){//if request has no content, return back directly
		document.getElementById("siteSearch").innerHTML = "";	
		return;
	}

	if(window.XMLHttpRequest){//get XMLHttpRequest
		xhr = new XMLHttpRequest();
	}
	else if (window.ActiveXObject) {
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	if (xhr != null){
		url = "database_search.php";
		url = url + "?q=" +search_request;	
		xhr.onreadystatechange = state_Change;//pass status change to xhr.onreadystatechange
		xhr.open("GET",url,true);//open and send methods have been used to send off request to server in Ajax
		xhr.send(null);
	}
	else { 
		alert("Problem occur when access on XMLHttpRequest");
		return;
	}
}	

function state_Change(){
/* state_Change is the method that triggered of the XMLHttpRequest changes its status. status might vary from 0 to 4,
  * where 0 is uninitialized and 4 is complete. And only when status is 4, the code will be able to execute.
  */
	if (xhr.readyState == 4) {
		document.getElementById("siteSearch").innerHTML = xhr.responseText;		
	}
}
	
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
	
var xhr2;
var url2;
function showUser(info){ 
		
	if(window.XMLHttpRequest){//get XMLHttpRequest
		xhr2 = new XMLHttpRequest();
	}
	else if (window.ActiveXObject) {
		xhr2 = new ActiveXObject("Microsoft.XMLHTTP");
	}
	  
	if (xhr2==null){
		alert ("Browser does not support HTTP Request");
		return;
	} 
	url2="moduleinfo.php";
	url2=url2+"?q="+info;
	xhr2.onreadystatechange=stateChanged;
	xhr2.open("GET",url2,true);
	xhr2.send(null);
}	
function stateChanged() { 
	if (xhr2.readyState==4){
		document.getElementById("txtHint").innerHTML=xhr2.responseText;
	}
} 	
</script>
</head>
<body>
<?php
if(isset($_GET['page'])){
 $page=$_GET['page'];
 }else{
 $page='home';
 }
 ?>
<div id="logo"></div>
<div id="logo2"></div>
<div id="logo3"></div>
<div id="button">
<ul>
<li><a href="index3.php?page=home">Home</a></li>
<li><a href="department.php">The Department</a></li>
<li><a href="courses.php?page=undgrad">Courses</a></li>
<li><a href='index3.php?page=money'>Financial Help</a></li>
<li><a href='index3.php?page=staff'>Staff</a></li>
<li><a href="faq.php">FAQ</a></li>
<li><a href="search.php">Search</a></li>
<li><a href='index3.php?page=contact'>Contact Us</a></li>
<li><a href="map.html">Site Map</a></li>
</ul>
</div>
<div id="content">
<div  STYLE="word-wrap: break-word; overflow:visible;">
<p style="font-size: 70%;"><a href="index3.php?page=home">Home</a>&nbsp;&gt;&nbsp;Search</p>
<br /><br />
<p>
<div id="txtHint"><b></b></div>
</p>
<br />
<form>
<br />
<b>Search for modules: </b>&nbsp;&nbsp;<input type="text" onkeyup="searchDB(this.value)">
 
<div id = "siteSearch"></div>
</form>
<br /><br /><br /><br /><br />
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> 
<table width="100%" border="0">
  <tr>
    <td colspan="2" bgcolor="#CCCCCC">&nbsp;</td>
  </tr>
  <tr>
    <td width="53%" bgcolor="#FFFFFF"><div align="center" class="style3">
      <div align="left"> &copy; Loughborough University 2008</div>
    </div></td>
    <td width="47%" bgcolor="#FFFFFF"><div align="center"><span class="style3"><a href="admin_login.htm">Staff</a></span></div></td>
  </tr>
</table>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -